Oct 20, 2010 09:19 PM
(This post was last modified: Oct 21, 2010 09:33 AM by Pulser.)
C# Events
What Is It:
An event in C#..is well..something that happens, an action.
There are a ton of different events, in this tutorial we are going to explore 2 of them.
Getting Started:
First start by clicking on the events tab:
[IMG]http://i51.[censored].com/2le4ewi.jpg[/IMG]
After clicking this tab you will notice all of the different events for the component of your choice, for this example we are going to use a label.
Click Event:
Under my first label I double clicked the "Click" event. This event is what happens when the label is clicked.
Spoiler (Click to View)
Mouse Enter Event:
This event will execute when the mouse enters the label area.
Spoiler (Click to View)
Conclusion:
There are many many more events, you can explore all of them by viewing the events tab for your component.
Code:
Code
private void label1_Click(object sender, EventArgs e)
{
MessageBox.Show("I Clicked The Label!");
}
private void label1_MouseEnter(object sender, EventArgs e)
{
MessageBox.Show("Mouse Entered!");
}http://www.pulsecodes.info
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.
Computer and Information Science major.
Information Technology Apprentice.
Freelance Programmer.


