G
Guest
I am trying to change the text on a button face to bold and/or to regular via
code using C#. I cannot seem to get it to work. Could someone offer me some
examples?
Here is my code:
public void UnboldAll()
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is Button)
(ctrl as Button).Font = new Font((ctrl as Button).Font,(ctrl as
Button).Font.Style | FontStyle.Regular);
}
}
I get the following compile error:
frmDatePicker.cs(88): No overload for method 'Font' takes '2' arguments
Thanks in advance,
Noble
code using C#. I cannot seem to get it to work. Could someone offer me some
examples?
Here is my code:
public void UnboldAll()
{
foreach (Control ctrl in this.Controls)
{
if (ctrl is Button)
(ctrl as Button).Font = new Font((ctrl as Button).Font,(ctrl as
Button).Font.Style | FontStyle.Regular);
}
}
I get the following compile error:
frmDatePicker.cs(88): No overload for method 'Font' takes '2' arguments
Thanks in advance,
Noble