Include forms into a 'big' form ?

Jelmer

Regular
Joined
Jan 11, 2006
Messages
96
I've got a form (maximised) splittet in 2 sections.
On the left side a Listbar.

My plan is: if i press a button on the (converted listbar (outlook look)) that there is loaded an form on the right part of the form.

Is that possible? And how ?
Can i include a form into a panel ?

Greets,

Jelmer
 
Yes, and no. It is possible to achieve an effect similar to the one you describe, however you can't do it by putting a form in a panel. You can put forms inside a main form by creating an MDI application, but it will require some alterations to what you have already done.
 
@Cags: is there a easy tutorial for?
@PlausiblyDamp: thnx for the link.. but its complex...

I'll tried something..
I'll made a UserControl item, and placed some data into that...

But how can i get it into a panel ore something..
The quickstarts of that project work.. but are to complex.

Its only a small program for me..
 
Jelmer said:
@Cags: is there a easy tutorial for?
@PlausiblyDamp: thnx for the link.. but its complex...

I'll tried something..
I'll made a UserControl item, and placed some data into that...

But how can i get it into a panel ore something..
The quickstarts of that project work.. but are to complex.

Its only a small program for me..

Alot of it depends what you want to appear on this Form/Panel. It sounds to me like you could probably achieve your desired effect using a UserControl. If this is the case then simply place it in the Panel, or alternatively where the panel is currently located (as theres no real need for the panel if everything is contained within a UserControl).
 
I've got all controls into the UserControl right now.
But how can i get the UserControl's items into the panel.

Look:

On the left side i've got a few buttons.
If i press one button1 i need usercontrol1, if i press button2 i need usercontrol2....

I like to get the usercontrol into the panel on the left side.
How can i do that ?

Panel3.?? = UserControl1; ?
 
not really.. i'll get an error:

Code:
panel3.Controls.Add(UserControl1);

Error:
Usercontrol1 is a 'type' but is used like a variable
 
What PlausiblyDamp was implying was that you would add an instance of UserControl1 to the panel. A more accurate example of 'actual' code would be...
C#:
UserControl1 myCtrl = new UserControl1();
panel3.Controls.Add(myCtrl);
UserControl1 is a class, in OO programming you cannot simply use this class as a control, you have to create an instance of it.
 
Yiihaaaa
It works thanx !!!
Sometimes its as easy as that.. haha :cool:

Now i can finish my Outlook style program :cool:
 
Back
Top