Farzad Akbarnejad
asked on
Changing font of label at runtime
Hello,
I have a label on a form. When I want to change the font of it at run time, it gives me an error that "The property is read-only".
label1.Font.Bold = true;
How can I change the font of label or textbox at runtime?
Thanks
-FA
I have a label on a form. When I want to change the font of it at run time, it gives me an error that "The property is read-only".
label1.Font.Bold = true;
How can I change the font of label or textbox at runtime?
Thanks
-FA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
label1.Font.Bold is a readonly property
Label label1 = new Label();
Font font1 = new Font(FontFamily.GenericMon ospace,14, FontStyle. Bold);
label1.Font = font1;
Label label1 = new Label();
Font font1 = new Font(FontFamily.GenericMon
label1.Font = font1;
label1.Font = new System.Drawing.Font(label1 .Font,Font Style.Bold );
label1.Font = new Font(....)