Results 1 to 7 of 7

Thread: Control - font?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234

    Question Control - font?

    Is it possible e.g for label to set font style italic-underline?

    regard j

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    VB Code:
    1. ctrl.Font = New Font(ctrl.Font, FontStyle.Italic Or FontStyle.Underline)

  3. #3
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Thumbs up

    Yes. You can do it at design time, or at runtime.
    Code:
    lblSample.Font = New Drawing.Font("FontName", FontSizeAsSingle)
    ~Peter


  4. #4
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Thumbs up

    Edneeis
    ~Peter


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    Ok, I know how to set font and one font style(regular,bold,italic,underline). But I want to set two font styles, e.g I want to set label text display like this 'label caption', again if it's possible.

    regard j

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Originally posted by Edneeis
    VB Code:
    1. ctrl.Font = New Font(ctrl.Font, FontStyle.Italic Or FontStyle.Underline)
    You obviously didn't try the example posted (I don't mean to sound rude). To set more than one style at the sametime you use Or to add them together as shown.
    Last edited by Edneeis; Oct 29th, 2003 at 12:39 PM.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    Sorry Edneeis,
    yes you are right, your first post is solution. Once again I apologize for my laziness.

    regard j

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