If answer to this is yes
How can i find TextWidth of them separatly ?
Printable View
If answer to this is yes
How can i find TextWidth of them separatly ?
It's possible, by changing the font in any perspect (name, size, bold, italic...):
You'll see that the second one is twice as the first one (10 = 630; 20 = 1260) ;)VB Code:
Dim myString As String myString = "abcdef" Font.Size = 10 MsgBox TextWidth(myString) Font.Size = 20 MsgBox TextWidth(myString)
I don't mean that
example you given is the same Font and you are changing the size of it
thing that i want is to use different font
for example if one is "MS Sans Serif" other is "Verdana"
Already said in post #2.
VB Code:
Dim myString As String myString = "abcdef" Font.Name = "MS Sand Serif" MsgBox TextWidth(myString) Font.Name = "Verdana" MsgBox TextWidth(myString)
Sorry :blush:
I mean using in a user control and at tha same time
I want make control and want to use different font one for Caption and other for Text
I must find TextWidth of Caption and Text separatly
is it possible?
It can be easily done with a little help from a Label control:
Not quite nice, but it works ;)VB Code:
Label1.Caption="abcdefghijkl" Label1.AutoSize=True MsgBox Label1.Width