Results 1 to 6 of 6

Thread: Is it possible use two different font type in a usercontrol?

  1. #1

    Thread Starter
    Addicted Member BlueRose's Avatar
    Join Date
    Jan 2002
    Location
    ISTANBUL
    Posts
    245

    Is it possible use two different font type in a usercontrol?

    If answer to this is yes
    How can i find TextWidth of them separatly ?
    You can do while you think that you can do

    If you think my answer solve your question, please rate it.

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Is it possible use two different font type in a usercontrol?

    It's possible, by changing the font in any perspect (name, size, bold, italic...):

    VB Code:
    1. Dim myString As String
    2.     myString = "abcdef"
    3.         Font.Size = 10
    4.             MsgBox TextWidth(myString)
    5.         Font.Size = 20
    6.             MsgBox TextWidth(myString)
    You'll see that the second one is twice as the first one (10 = 630; 20 = 1260)

  3. #3

    Thread Starter
    Addicted Member BlueRose's Avatar
    Join Date
    Jan 2002
    Location
    ISTANBUL
    Posts
    245

    Re: Is it possible use two different font type in a usercontrol?

    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"
    You can do while you think that you can do

    If you think my answer solve your question, please rate it.

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Is it possible use two different font type in a usercontrol?

    Already said in post #2.

    VB Code:
    1. Dim myString As String
    2.     myString = "abcdef"
    3.         Font.Name = "MS Sand Serif"
    4.             MsgBox TextWidth(myString)
    5.         Font.Name = "Verdana"
    6.             MsgBox TextWidth(myString)

  5. #5

    Thread Starter
    Addicted Member BlueRose's Avatar
    Join Date
    Jan 2002
    Location
    ISTANBUL
    Posts
    245

    Re: Is it possible use two different font type in a usercontrol?

    Sorry

    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?
    You can do while you think that you can do

    If you think my answer solve your question, please rate it.

  6. #6
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Is it possible use two different font type in a usercontrol?

    It can be easily done with a little help from a Label control:

    VB Code:
    1. Label1.Caption="abcdefghijkl"
    2. Label1.AutoSize=True
    3.     MsgBox Label1.Width
    Not quite nice, but it works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width