Calculate pixel value based on textbox.text.length

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mervyn
    New Member
    • Jun 2007
    • 3

    Calculate pixel value based on textbox.text.length

    Hi There,

    I am very new to .NET and VB so this may be a really simple thing to solve but here is my issue

    I have a a textbox with a value in it. I know what the length of the text in the text box is. I would then like to set the width of the text box (in px) to an appropriate calculated value based on the length. So, if the text length is 50, I would need a text box of around 300px for the text to be shown without being truncated. Is there a method or formula to calculate this value?

    Many Regards,
    Mervyn (newbie)
Working...