Alan Coker from Greenville, SC writes:
Do you know of some Microsoft samples to download to see the proper way to build a win form app that has a common menu that is visible on every page that navigates to every page in the app? I'm not wanting to do a MDI app. I want a single window with a side menu on the left that loads multiple forms on the right side of the window. Someone told us to build one win form with the menu and to drag all the other pages on the right side as user controls and to hide and show them one at a time. I don't like having all of the user controls on the page at design time. We have a Web application where we did this by loading user controls in a placeholder programatically but there's not a placeholder for the Win Forms. I've been looking for a Microsoft example of this but I've haven't found any examples showing a common menu loading different pages.
It just so happens there is a new Application Block (specifically designed for the .NET Framework 2.0 and Visual Studio 2005) that might help Alan in this scenario. It's the Composite UI Application Block, and it essentially allows you to have a single form within which "pages" of functionality have been implemented as individual user controls. You drop the DeckWorkspace control on your form, and then by setting properties on it you can have various user controls with their sets of functionality become active. With this block you don't actually have the user controls on the form at design time, which should address Alan's concern there.
Hope this helps!