The best way in WinForms to sign up for an event is to select your control in the designer, open the Properties window and select the Events tab. Then select any event you want (click, MouseClick, etc.) and double-click on the space bar to the right of the event name. An event handler will be generated and subscribed to the event.
If you want to subscribe to the event manually, add an event handler to the event
picOneFaceUpA.MouseClick += PicOneFaceUpA_MouseClick;
Pressing Tab after writing += will generate a handler. Or you can write it manually:
void PicOneFaceUpA_MouseClick(object sender, MouseEventArgs e) {
BTW, if you do not need additional information about the click event (for example, which button is pressed), use Click instead. It handles left-clicks by default:
picOneFaceUpA.Click += PicOneFaceUpA_Click;
And the handler:
void PicOneFaceUpA_Click(object sender, EventArgs e) {
source share