65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.75/5 (4 votes)

Nov 8, 2010

CPOL
viewsIcon

23756

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