Change images of a groupbox with a click on a picturebox in C #

0

Good afternoon.

I need your help please. I'm a computer student and I'm doing a fast food sales system project.

In the program I have in a form, in the designer 2 groupbox and a datagridview, in the first groupbox I have 4 picturebox with images of hamburgers, juices, desserts and pizzas.

The problem is this: when I click on one of the picture boxes, it shows me in the second groupbox images of the product options.

That each time I click on hamburgers or juices or pizzas, I will show the product options in the second groupbox, but also pictureboxes

I would appreciate your help.

    
asked by jose miguel huertas rodas 24.05.2017 в 22:54
source

1 answer

0

If you do not see the code, you need to capture the Click event of the picureBox of the first group and in that event fill in the pictureBox of the second group with the images you want.

EDITED

Here is a very simple example where I assume that the images are added as resources

public Form1()
    {
        InitializeComponent();
        this.pictureBox1Group1.Click += new System.EventHandler(this.pictureBox1_Click);
    }

    private void pictureBox1_Click(object sender, EventArgs e)
    {
        pictureBox1Group2.Image = Resources.Image1;
        pictureBox2Group2.Image = Resources.Image2;
        pictureBox3Group2.Image = Resources.Image3;
        pictureBox4Group2.Image = Resources.Image4;
    }

I hope it serves you

    
answered by 25.05.2017 в 08:15