-2

I generated these buttons(sepete ekle) dynamically. This button has an click event.

I want to make : when this button clicked flowlayout panel add to groupbox control.

enter image description here

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

1

You have to register your button to the click event and then, transfert the control in your flowLayoutPanel

    private void Init()
    {
        button.Click += Button_Click;//you button
    }

    private void Button_Click(object sender, EventArgs e)
    {
        Button button = (Button) sender;

        panel.Controls.Remove(button);// your control containing the button...
        flowLayoutPanel.Controls.Add(button);// your flowLayoutPanel
    }
J-R Choiniere
  • 634
  • 5
  • 19