Windows Develop Bookmark and Share   
 index > Windows Forms General > How do i make MDI Parent & Child Forms in C#.NET as looks like as Master & Child Pages in ASP.NET?
 

How do i make MDI Parent & Child Forms in C#.NET as looks like as Master & Child Pages in ASP.NET?

C#:
I have to develop project that looks like "Master & child" Pages in ASP.net, i.e., "MDI-Parent & MDI-child" But here i need not want the titlebar for child form and should not have child form minimizeble (i.e, ChildForm should be fit in the content part of a MDI-Parent form).

Here my idea is, First i have to design a MDI Parent form with companies Logo picture bar & 3 buttons(Rounded Rectangular image buttons) namely "EntryForm" button, "UpdateForm" button, "ViewForm" button. In that if i clicked "EntryForm" button, then the Entryform MDI-child should be should in that MDI-Parent Form and as the same for other two buttons also. Note: Even though the MDI-Child form should works as it as independent form.
---Sri's
  • Moved byTaylorMichaelLMVPTuesday, September 22, 2009 1:30 PMWinForms related (From:Visual C# General)
  •  
My Best Solutions  Monday, September 14, 2009 2:38 PM
MDI is the wrong way to go if you're wanting to approximate master pages in ASP.NET. The right way to go is custom user controls.

I'd start here.
Coding Light - Illuminated Ideas and Algorithms in Software
Coding Light Wiki �LinkedIn �ForumsBrowser
David M Morton  Monday, September 14, 2009 2:40 PM
tanx.. for ur fast reply.

At Present i'm using the Custom User controls, But getting confusions in linking the custom user control forms. I have used (designed) 3 custom controls (UC_EntryForm, UC_UpdateForm, UC_ViewForm) as a child form looks. And One Normal Window Form with BackGround Companies Logo picture and a Panel (into which the custom controls will shown) & 3 buttons. For each button has needs a code to load a specific custom user control. How?

for sample image: http://myarticles-csharpnetstuff.blogspot.com/2009/09/how-do-i-make-mdi-parent-child-forms-in.html




My Best Solutions  Monday, September 14, 2009 2:53 PM
The button click handlers should be handled by the main form that contains them. This form should perform operations to instantiate and position the user controls that are the sub-controls you want to show.

That being said, you might want to look into the TabControl instead. It might be exactly what you're looking for, actually.
Coding Light - Illuminated Ideas and Algorithms in Software
Coding Light Wiki �LinkedIn �ForumsBrowser
David M Morton  Monday, September 14, 2009 2:56 PM
Can u provide me the concept on CustomControls with sample Program.. Plz..
---Sri's
My Best Solutions  Thursday, September 17, 2009 3:46 PM
Hi,

You might want to add theusercontrol to the controlcollection of the form:

if (c != null)
{
this.Controls.Remove(c);
c = new UserControl1();
this.Controls.Add(c);

}

Please take a look at the project here:
http://cid-219dc49fbdfffbd1.skydrive.live.com/self.aspx/Public/WindowsFormsApplication15.rar

If there are unmanaged objects in your usercontrol , you might need to call : c.Dispose() to release them.

Hope it will help,
Harry
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Harry Zhu  Monday, September 21, 2009 3:57 AM
Exactly i did'nt know till now clearly about Managed & unManaged Objects. This topic always i get confused, anyway can u tell me in an easy procedure.. Plzzzzzzz

---Sri's
My Best Solutions  Tuesday, September 22, 2009 12:47 PM
Hi,

Does the code in my post work?

When we define a class with unmanaged resources , we need to release it in our code, since CLR normallydoes not release it.
So we can release these unmanaged resources in finalizer method. however, it will take long time to release it ( You might want to take a look at some artical about generationof GC) . We can make up adispose method to doreleasingwork , it can be called by users when theydon't need the object that references unmanaged resourcesto reduce the timeto release object .

If you are not familiar with the concept , you might need to create a new thread about specific quesiton.

Harry
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Harry Zhu  Wednesday, September 23, 2009 2:38 AM

You can use google to search for other answers

Custom Search

More Threads

• Webbrowser Control:Position of images in iframes/frames
• List view to form view and back
• Writing your name in a picture box - drawing program
• VB2008 newwindow javascript popups are inaccessible to webbrowser
• Disabled Button Controls
• WebBrowser Control hides exceptions that occur in in event handlers
• Calendar Control DataChanged Event firing every 2 minutes
• RichTextBox.Select method and offsets
• TreeView control missing datasource property
• FolderBrowser