We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GroupBar: Preferred usage

Thread ID:

Created:

Updated:

Platform:

Replies:

9191 Dec 10,2003 03:31 AM UTC Dec 10,2003 06:29 PM UTC WinForms 2
loading
Tags: Tools
Administrator [Syncfusion]
Asked On December 10, 2003 03:31 AM UTC

Hi, I''m designing an app at the moment and was thinking about how to best use the GroupBar. The issue is simple, but there are lots of ways to solve the problem. I figured I''d post here to see if there''s a consensus on the best design. Until just recently, I''ve mainly been using Java so I know what I''d choose with Swing, but the tradeoffs may be different here. (Likewise, as with all things in software design, there is not one right answer and there are tradeoffs.) I didn''t see anything like this in the Samples, but please let me know if I missed something. If not, it might make a good idea. The situation: I''ve got an app with a dozen or so major areas. The details are irrelevant, so imagine Outlook with its email, groups, calendars, contacts, etc. I use a GroupBar to let users move between there areas. (Each area is pretty complex and will probably have things like tabs, docking, etc. depending on the area.) The question: What should happen when the user clicks on a particular GroupViewItem? Here are some (but not all) of the possibilities: 1. Use a CardLayout (like in Java) 2. In the GroupViewItemSelected handler, remove the current panel in that space, new() the selected panel and add it to the form 3. Place an empty panel in the form to serve as the parent for all these user controls. In the GroupViewItemSelected handler, remove the current panel from that holder panel, new() the selected panel and add it to that panel 4&5. Same as 2 & 3, but instead of new()ing panels each time, hold on to them and just add or remove them 6. Something I didn''t even think of off the top of my head. While the differences are relatively small, hopefully you folks have some feelings about the best design. Thanks, dan

Administrator [Syncfusion]
Replied On December 10, 2003 03:39 AM UTC

(and sorry that the apostrophes appear as double quotes; I pasted from my editor and didn''t check the results)

Ramesh Praveen [Syncfusion]
Replied On December 10, 2003 06:29 PM UTC

We would recommend not "newing" a Panel every time, instead just keep it around and reuse them. Then, since you would simply show one Panel at a time, and that is exactly what a CardLayout does we recommend option 1. Some other options that we could think of: Use a MDI setup. Where each "area" will be represented by a Child Form. Then you will simply activate the appropriate child forms in the GroupBar''s selected events. The advantage of using child-forms is that menus and toolbars can be associated with those child-forms which will automatically merge with the main form during runtime when the child form gets activated. If you do decide to go with the CardLayout and UserControl setup, another thing you might want to consider is whether or not you want to pull the UserControls into the main-form''s designer. Because when there are too many controls on the form, the designer slows down quite a bit during load. You should then instead initialize the CardLayout and the UserControls in code. -Praveen

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;