Hi i have Visual C#.
Just wondering:
i have made an interface for a program launcher, but i do not know how to to link the buttons with the program. can someone help please.
Thanks in advance
Martin
Hi i have Visual C#.
Just wondering:
i have made an interface for a program launcher, but i do not know how to to link the buttons with the program. can someone help please.
Thanks in advance
Martin
interface
pknepper
if you made your interface in the VS' designer then a double click on the button will create an event handler that will run whenever you press the button when running the application. You just have to insert the code in that method (event handler created).
You can also go manually to the event properties and add the event handler's name and VS will automatically create one with the name you picked. To do this, in the designer choose the button, in the properties tab click on the button with an image that is similar to a little thunder and in the action->click just insert a name or double click to insert a new event handler.
If you did the interface without the designer you have to add the event handler manually:
this.button1.Click += new System.EventHandler(this.button1_Click);
and define the event handler method:
private void button1_Click(object sender, EventArgs e)
{
// code
}