Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 8th, 2008, 8:10 AM   #1
Druid
Programmer
 
Join Date: Mar 2006
Posts: 40
Rep Power: 0 Druid is on a distinguished road
(C#) Too many forms in my program, want to consolidate.

I have written a C# program that uses 20+ windows forms. Instead of opening a new window every time a user selects a menu item or clicks a button, I want it to open in the same window. Like having a section of the main window to hold the content of the form, instead of creating a separate form.

I was looking into panels and tabs, but I want the layout to be as transparent as possible to the user. Can anyone suggest a component to use or any other ideas?
Druid is offline   Reply With Quote
Old Jan 8th, 2008, 8:55 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,825
Rep Power: 5 Sane will become famous soon enough
Re: (C#) Too many forms in my program, want to consolidate.

The conventional thing to do for that is notepad tabs, as you've pointed out.

If you don't think that would look very nice, then you could group together each layout on a different panel. And then, at will, toggle which panel in memory is visible in the current form. At least this is what's done in other GUI toolkits I've used. It should be applicable to C#, or at least close.
Sane is offline   Reply With Quote
Old Jan 8th, 2008, 6:04 PM   #3
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: (C#) Too many forms in my program, want to consolidate.

Quote:
Originally Posted by Druid
I was looking into panels and tabs, but I want the layout to be as transparent as possible to the user. Can anyone suggest a component to use or any other ideas?
I can understand your concern with tabs, if you want it to be transparent to the user. However, why the concern with panels? Just create multiple panels of the same size in the same location, and only have one visible at a time.

The only gotcha with this approach is you will need to name your controls in such a manner as to avoid name conflicts. For example, btnNext might become btnPanel1Next.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Jan 8th, 2008, 7:59 PM   #4
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: (C#) Too many forms in my program, want to consolidate.

I have seen several interfaces with multiple panels selectable from push buttons and tree views. Works great. Think of PuTTY and the Firefox options page.

lectric is right about the namespace issue. Also consider the difficulty in dealing with such a layout in the VS designer. You have to change the z-order of the panels to get to the one you want to edit. What you can also do...create a separate class for each panel (user control, inherited control, can't remember). Add a new instance of the desired panel and set it to Dock Full when a section/button is selected.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hello, I'd like to write a program for my work. blake_jl Community Introductions 13 Nov 23rd, 2007 4:31 PM
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM
Creating a program to test a program sixstringartist C 8 Jan 21st, 2006 1:15 PM
move program console window back badbasser98 C++ 21 Oct 18th, 2005 2:02 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC