Hi Mike,
Changing the width is the easy part. The hard part is finding the correct
value that represents the pixel width of the font being used. Not sure out
to do that.
Dim decPixelsPerChararacter As Decimal = 6.5
Dim strText As String = "This is my long string which" & _
" I need to measure."
Dim intLength As Integer
intLength = Len(strText) * decPixelsPerChararacter
TextBox2.Width = New WebControls.Unit(intLength)
TextBox2.Text = strText
"Mike Towle" <> wrote in message
news:F9A00CD9-CC69-4DA2-8E43-...
>I would like to autosize the width of a textbox control based on the value
>of the control. Is there a function that will determine what the width
>should be for a control based on the text value of the control or a string
>that I pass it?
|