xxxxxxxxxx
// note: this is with the defualt VS project template
// ------------------ define the event --------------------
// In the Form1.Designer.cs File (or however you call it),
// inside the InitializeComponent() method, add the code in the
// method to specify what event you want the method you created to occur on,
// but make sure to change the names of the method and item.
// this.Component.Event += new System.EventHandler(this.MethodName);
this.buttonExample.Click += new System.EventHandler(this.clickButton);
// ---------- Create the method that will occur -----------
// In the Form1.cs File we add the actual method that will be called,
// when the event is occured (in this case, when the button is clicked)
// put this inside the Form1 class (or however you call it)
private void clickButton(object sender, EventArgs e){
// you have to make sure that the method's name matches the name inside
// System.EventHandler();
MessageBox.Show("Hello, World!");
}