
Signature
Ruben Lysemose, Systems Consultant
> > In VB2008: On a new form, placed a splitcontainer vertically: OK.
> > Two new panels placed on top of right panel (same size and different
[quoted text clipped - 15 lines]
>
> Michael
> Michael, what would the benefit be of developing several user controls (to
> be
> used in this project only) compared to the develop-several-forms approach?
You can't host a form inside another form (at least not without hacks).
> It
> seems much easier to design forms
It's pretty much the same really, you just drag and drop controls, move them
around etc.
> - and I guess user controls will still need
> to load data just as separate forms(?)
Not necessarily, you could a class that holds the required data and pass an
instance of that class to each control. Generally you'd create an interface
for each of the controls to implement.
Michael
Ruben L - 24 Jan 2008 00:53 GMT
Thanks Michael. It looks like that's the right track!
For other newbies: Project - Add User Control - let the user Control
template remain selected and change name - Add - and you have a new Form
Designer Window. Do your stuff as you would with a form and then Build the
project.
The user control will now be available in your toolbox in a "MyProjects
Components" section - visible when in form design.
For the Outlook-a like - situation mentioned above: add the user controls on
top of each other and use BringToFront/back. Works so far :-)

Signature
Ruben Lysemose, Systems Consultant
> > Michael, what would the benefit be of developing several user controls (to
> > be
[quoted text clipped - 16 lines]
>
> Michael
Michael C - 24 Jan 2008 23:43 GMT
> Thanks Michael. It looks like that's the right track!
>
[quoted text clipped - 7 lines]
> on
> top of each other and use BringToFront/back. Works so far :-)
One other thing worth considering is adding an interface to each of these
controls. For example, if every control needs to have a method called
PopulateData then you would define an interface like this
public interface IWhatever
{
void PopulateData();
}
then in your usercontrols add this
public MyUsercontrol : UserControl, IWhatever
then right click IWhatever and select Implement.
This way all your controls can be treated as an IWhatever and you can define
an IWhatever array to store them in.
Michael