Windows Develop Bookmark and Share   
 index > Windows Forms General > Help to make windows application like master page
 

Help to make windows application like master page

Hi, I want to make my windows application like master page. Suppose that when i select menus the contents will be shown on same windows. Is it possible then help me please by giving me some ideas. Thanks for advance.
somel  Monday, September 24, 2007 3:02 PM
Hi there!

Yes it's very possible. I've never been fan of dialog boxes and MDI forms, I do prefer to have everything displayed in one window too so here's how I do that.

First, You'll have to think of the content layout. Since you made the analogy with the master page, I'm guessing you know a little bit about asp.net, so to build on this analogy, you'll have:

Master page = Main form
Page = User control

Instead of forms, you're going to have to work with user controls that you'll host inside content panels.

What you are going to find a bit confusing is a way to exchange data from the form to the user controls. One way to do it, and the one I do prefer, is to use events.

You can read more about it here.
Younes Ouhbi  Monday, September 24, 2007 3:16 PM

you can create a few controls to place on the form, when you select different menuitems, you can hide the rest and show the ones you want. Smile
H. _冬_ Tony  Monday, September 24, 2007 3:08 PM
Hi there!

Yes it's very possible. I've never been fan of dialog boxes and MDI forms, I do prefer to have everything displayed in one window too so here's how I do that.

First, You'll have to think of the content layout. Since you made the analogy with the master page, I'm guessing you know a little bit about asp.net, so to build on this analogy, you'll have:

Master page = Main form
Page = User control

Instead of forms, you're going to have to work with user controls that you'll host inside content panels.

What you are going to find a bit confusing is a way to exchange data from the form to the user controls. One way to do it, and the one I do prefer, is to use events.

You can read more about it here.
Younes Ouhbi  Monday, September 24, 2007 3:16 PM
I think that the content panels/user control way is the way to do it, but I disagree with your method of exchanging data. The best way to implement this is using the MVC (Model View Controller) Pattern where you simply have different UIDelegates(View+Controller(User Control)) attached to your Model (Data), then your simply swap UIDelegates and have them update themselves from the model.

If you use an MVC approach you will not be exchanging data between forms/controls but simply between the view and the model, and vice versa. A nice way to implement this is using the Update React strategy. Simply put when the user updates the view you copy the data to the model, and when the model is updated you update the views that are attached to it through a registered delegate (Basically an event).




http://en.wikipedia.org/wiki/Model-view-controller
CalvinR  Monday, September 24, 2007 3:47 PM

Hi Ouhbi,

Would u explain it details with some code bz i have a little knowledge about master page.

somel  Monday, September 24, 2007 5:28 PM

You can use google to search for other answers

Custom Search

More Threads

• Comapre selected dates in a DateAndTimePicker...?
• Client Area of MDIParent should not be sunken
• Dock Repositioning
• My project is corrupted ????
• Strange behaviour of shourtcut on buttons
• Multi Window Events - Application Design the Right Way
• TreeView Problem
• How to get a handle on executable file in C#?
• Passing a Method as a Delegate from one thread to another for feedback purposes
• App Requirement