The width of a string depends upon the object in which you display it.
VB provides a function called .TEXTWIDTH which applies to forms and pictureboxes (for example)
The result changes according to:
The scalemode of the object
The font in question AT THE TIME YOU ASK
The display settings.
So, briefly, set the form's font to Arial 8, set the scalemode of the form to PIXELS, and get the result of
Form1.textwidth("Hello"
This get more complex if the string is long and expected to word wrap...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.