Resizing a textbox at runtime?

C

Carl Mercier

Hi,

I am trying to resize a textbox at runtime depending on the browser but for
whatever reason, the textbox is not resized. It stays at the original size.
How can I do what I want?

Here's the code I have in my web user control:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim browser As String = Request.Browser.Type.ToUpper

If browser.IndexOf("NETSCAPE") > -1 Or browser.IndexOf("NS") > -1
Then
textBoxWidth = 15
ElseIf browser.IndexOf("IE") > -1 Then
textBoxWidth = 75
ElseIf browser.IndexOf("OPERA") > -1 Then
textBoxWidth = 15
End If

txtUser.Width = New UI.WebControls.Unit(textBoxWidth)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top