Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop / WinForms

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

3.75/5 (4 votes)
8 Nov 2010CPOL 23.7K  
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)