Dynamically setting textbox width

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?
 
G

Guest

Hello

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

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

Kind Regards
Jorge
 

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

Top