Question Load Panel

Tomst

New member
Joined
Feb 12, 2010
Messages
2
Programming Experience
Beginner
Hello,
How can I have a new Panel load with a Button click.
Thanks
 
Controls are objects just like any other, so you create them like you do any other objects. Create a new Panel object as you would expect: using the New keyword. Configure as required by setting the appropriate properties, e.g. Size and Location. Finally, to display a control you must add it to the Controls collection of the appropriate parent, e.g. the form or some other container.

You already have examples at your disposal but you just didn't know it. When you add an configure controls in the designer, the IDE generates the corresponding code. In the Solution Explorer, click the Show All Files button and then expand the node for your form. You'll see a designer.vb file. Open that and you'll see that code, which will look pretty much like I described above.
 
Back
Top