How to make a class with a group of controls?

  • Thread starter Thread starter Ron L
  • Start date Start date
R

Ron L

I have a group of controls that make up a "form". This "form" may be used
for displaying data in a database, entering new data, editing existing data,
or entering search criteria. I want to create a class that has the controls
for the "form" and the layout stored, but that can be used either on a
stand-alone form or on a tab control (or possibly in other ways that I
haven't come up with yet). I don't think that this usage really constitutes
a VB Form, but is there some way of doing this?

TIA
Ron L
 
From Visual Studio, select File - Add New Item - User Control. Click on Open.
Drag controls from the Toolbox onto the new usercontrol. Build your project.

Now open a form in your project. Open the Toolbox and you can now see a My
User Controls tab with your new usercontrol on. You can drag the usercontrol
onto your form as you would with any other Toolbox control.

Regards,
Phil.
 
I have a group of controls that make up a "form". This "form" may be
used for displaying data in a database, entering new data, editing
existing data, or entering search criteria. I want to create a class
that has the controls for the "form" and the layout stored, but that
can be used either on a stand-alone form or on a tab control (or
possibly in other ways that I haven't come up with yet). I don't
think that this usage really constitutes a VB Form, but is there some
way of doing this?

TIA
Ron L

How about creating a user control with all the controls and coding
logic in it. You can then add this to a form, tab control or whatever?
 
Back
Top