Click here to Skip to main content
12,245,040 members (61,533 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

15.2K views
5 bookmarked
Posted

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

, 8 Nov 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Code snippet to make a control's text font style to bold dynamically at runtime in a windows application
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)

Share

About the Author

No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralThanks for voting. But, there will be beginners as well, who... Pin
TheDotNetGeek17-Nov-10 19:23
memberTheDotNetGeek17-Nov-10 19:23 
GeneralReason for my vote of 2 Extremely basic info Pin
PSU Steve15-Nov-10 11:52
memberPSU Steve15-Nov-10 11:52 
GeneralReason for my vote of 4 Thanks! Pin
Maggi38-Nov-10 6:49
memberMaggi38-Nov-10 6:49 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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