Well, I assume that you have launched the reservation form from Form 1, where you show the button with the court. Thus, the code will look something like this in Form1 (where you have the image button in court):
FormBooking frm = new FormBooking(); frm.Controls["nameofbooking_button"].Click += (se,ev) =>{
Now, when this button is pressed on the reservation form, you will see an image button with the image of the vessel.
And if its 2005, which is .Net 2.0, so we donβt have lambda, so here is the code:
FormBooking frm = new FormBooking(); frm.Controls["nameofbooking_button"].Click += new EventHandler(ChangeImage); frm.Show();
then some where in your class Form1:
private void ChangeImage(object sender, EventArgs e) {
source share