Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# newbie (as in real new) Tryin

Status
Not open for further replies.

needscoop

Programmer
Nov 13, 2002
29
US
C# newbie (as in real new)

Trying to make a label bold when user clicks it - but this
code does not build. Any idea why? (from Windows application)

private void lblMain_Click(object sender, System.EventArgs e)
{
this.lblMain.Font.Bold = True;
}
 
This is an example for you. The bold item is "read only" so you can't do that, by the way:

lblAmount.Click += new EventHandler(lblAmount_Click); Our event

Our event action:
public void lblAmount_Click(object sender, EventArgs ea)
{
Font fontbold = new Font(Font, FontStyle.Bold);
lblAmount.Font = fontbold;
} The weevil of doooooooooom
-The eagle may soar, but the weasel never gets sucked up by a jet engine (Anonymous)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top