I have UserControls that are "Buttons" for Menu purposes. Those Buttons shall automatically add to the right Panel.
So basically, if I write:
MenueButton button1 = new MenueButton();
the button shall automatically be added to MenuePanel on GUI Form. (Maybe Some easy action handler?)
Is there a way to achieve this?
Try something like
This way the CreateButton function creates and automatically adds the button to the panel and you can use the newly created button in your code
If you want to do the same thing to the buttons you can add parameters to your function