Thread: Changing a labels font properties

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    98

    Changing a labels font properties

    How can I change the font properties, such as bold text etc, of a label during runtime?
    I tried setting label1.Font.Bold to true but it says that it is read only.
    Please help.

  2. #2
    Registered User
    Join Date
    Aug 2007
    Location
    Gloucester, England
    Posts
    11

    Smile Assign a new Font

    Hi,

    You can assign a new Font to the Label1.Font property like this:

    Code:
    label1.Font = new Font(label1.Font, FontStyle.Bold);


    Regards
    Pete

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    98
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with my font manager
    By hannibar in forum C Programming
    Replies: 1
    Last Post: 03-07-2006, 08:03 AM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  3. Changing Font (Word COM)
    By UnclePunker in forum Windows Programming
    Replies: 1
    Last Post: 03-22-2004, 11:30 AM
  4. Changing font in rich edit, without affecting undo buffer
    By jverkoey in forum Windows Programming
    Replies: 3
    Last Post: 01-17-2004, 08:54 PM
  5. Changing the font on static text and buttons
    By Unregistered in forum Windows Programming
    Replies: 3
    Last Post: 06-28-2002, 09:36 AM