Dynamically setting textbox width

  • Thread starter Thread starter Jacques Leclerc
  • Start date Start date
J

Jacques Leclerc

What's the trick to dynamically setting the width of a textbox?

In the code behind page Page_Load function I'm trying to dynamically set the
width of a textbox.

TextBox1.Width = "75px"

I keep getting an error that the size has to be in WebControls.Units.

I tried doing a CType to cast the value as a WebControl Unit and also tried
using "75" and 75. Neither worked.

What am I missing?
 
Hello

I tried textbox1.width = 75 and it worked fine..

How about : Me.TextBox1.Size = New System.Drawing.Size
(80, 20)

Kind Regards
Jorge
 
Back
Top