Click here to Skip to main content
Click here to Skip to main content

Make a control's text font bold at runtime in a windows application

By , 8 Nov 2010
 
Hi,
 
This code snippet is to change the font style of a control. This is specially useful for controls that are dynamically added from code at runtime.
 
lblSample.Font = new Font(lblSample.Font, FontStyle.Bold);
chkSample.Font = new Font(chkSample.Font, FontStyle.Bold);
 
Thanks,
DnG

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralThanks for voting. But, there will be beginners as well, who...memberTheDotNetGeek17-Nov-10 18:23 
GeneralReason for my vote of 2 Extremely basic infomemberPSU Steve15-Nov-10 10:52 
GeneralReason for my vote of 4 Thanks!memberMaggi38-Nov-10 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130617.1 | Last Updated 8 Nov 2010
Article Copyright 2010 by TheDotNetGeek
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid