I want to adjust the length of a label/ text box at run time by knowing the length of a string in pixel.
Is there any way to know this ?
Thanks in advance..
Printable View
I want to adjust the length of a label/ text box at run time by knowing the length of a string in pixel.
Is there any way to know this ?
Thanks in advance..
If you put the form's ScaleMode to Pixel, then you just need to use TextWidth(Text1.Text), if its not in Pixel mode, then you will need to scale it using the ScaleX method of the form.
And Label's have an AutoSize property, so you really don't need to worry about them.
:)
Thanks for yor replies...:)