[RESOLVED] What are split containers used for?
Hi,
I've just been looking at some sample code/project.
The form in this project uses vertical split containers and Horizontal split containers.
I can't understand why they are used. I mean, in one containers there is only a tree view. So why wouldn't the developer/designer simply put a treeview in one part of the form, and leave out the split container.
Regards,
Kareem
Re: What are split containers used for?
There are a thousand and one use for them.
In this case, the TreeView is probably anchored to the left side and then the individual can resize it to see more content if they like. Then the other data is displayed in the right panel of the split container.
This is evident in a Windows' explorer window.
Re: What are split containers used for?
Have you ever used Windows Explorer? Notice how it has two panes: one on the left for the folder tree and one on the right for the file list. Have you ever dragged the bar between the two to adjust their relative sizes? That is what a SplitContainer does. Without it the TreeView would occupy a static amount of space. With the SplitContainer, the user gets to decide how much space each pane occupies.
Visual Studio itself is a great example of the use of the SplitContainer. In VS you often have a code window open at the same time as the Toolbox, the Solution Explorer, the Properties window and possibly others too. It's the SplitContainer that lets you drag the bars between those docked windows and the main window to control how much of each you can see. Outlook is another example, as are so many other applications that display multiple panes in the one window.
Re: What are split containers used for?
ever used File Explorer? Ever get so deep into the different folders that you have to scroll left/right to see things in the tree? That's why.... because not everyone';s screens are the same... sometimes the user needs to have the ability to make that tree view wider.
SQL Server Management Studio is the same way.... after I click open the Server, database, progammability, functions, table function, the function, the parameters..... I'm burried pretty deep... if the developer only gave me a 2 inch window to see all that.... I'd nbever use SSMS.
It's a usability/convenience thing.
-tg
Re: What are split containers used for?
Hi,
Yes, I see what you mean.
I can now see that it can be very useful.
Regards,
Kareem.