Changing a labels font properties

This is a discussion on Changing a labels font properties within the C# Programming forums, part of the General Programming Boards category; How can I change the font properties, such as bold text etc, of a label during runtime? I tried setting ...

  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, 10:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21