Jelmer Posted March 7, 2006 Posted March 7, 2006 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 Quote
Cags Posted March 7, 2006 Posted March 7, 2006 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. Quote Anybody looking for a graduate programmer (Midlands, England)?
Administrators PlausiblyDamp Posted March 7, 2006 Administrators Posted March 7, 2006 Rather than using forms you probably want to create the re-usable UI bits as controls - this will allow you to load them on demand into another form. http://msdn.microsoft.com/practices/apptype/smartclient/default.aspx?pull=/library/en-us/dnpag2/html/cab.asp is a link you may want to investigate as it provides a framework for this kind of composite UI. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jelmer Posted March 8, 2006 Author Posted March 8, 2006 @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.. Quote
Cags Posted March 8, 2006 Posted March 8, 2006 @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). Quote Anybody looking for a graduate programmer (Midlands, England)?
Jelmer Posted March 8, 2006 Author Posted March 8, 2006 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; ? Quote
Administrators PlausiblyDamp Posted March 8, 2006 Administrators Posted March 8, 2006 Panel3.Controls.Add(UserControl1); should do it. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jelmer Posted March 9, 2006 Author Posted March 9, 2006 not really.. i'll get an error: panel3.Controls.Add(UserControl1); Error: Usercontrol1 is a 'type' but is used like a variable Quote
Cags Posted March 9, 2006 Posted March 9, 2006 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... 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. Quote Anybody looking for a graduate programmer (Midlands, England)?
Jelmer Posted March 9, 2006 Author Posted March 9, 2006 Yiihaaaa It works thanx !!! Sometimes its as easy as that.. haha :cool: Now i can finish my Outlook style program :cool: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.