Groups | Blog | Home
all groups > dotnet windows forms > january 2006 >

dotnet windows forms : Difference between Panel and GroupBox


A.M-SG
1/12/2006 6:44:25 PM
Hi,



I understand that GroupBox provides a caption and border around a group of
controls, but other than that, what is the different between a Panel and
GroupBox?



Thank you,

Alan



Herfried K. Wagner [MVP]
1/13/2006 2:05:06 AM
"A.M-SG" <alanalan@newsgroup.nospam> schrieb:
[quoted text, click to view]

Groupbox is not scrollable.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
A.M-SG
1/13/2006 12:57:19 PM
Thank you for help.

Is there any reason that I should use GroupBox instead of Pannel at all ?



[quoted text, click to view]

Bonnie Berent [C# MVP]
1/15/2006 1:39:03 PM
[quoted text, click to view]

Sure there is! It's a great way to visually group things for your user.

~~Bonnie


[quoted text, click to view]
Bonnie Berent [C# MVP]
1/16/2006 8:56:03 AM
OK, yeah, you can have a visible border with a Panel, so in that respect you
have a visual cue for the user that you are grouping stuff together. However,
there is no caption, so there's no way to label that Panel without dropping a
Label control there somewhere too. I still prefer the GroupBox for this sort
of visual cue.

In my opinion, the purpose of Panels is to divide up a form when needed for
scrollbars and such. For example, you have a ListView on your form that takes
up the whole width of the form, but you also have a spot where you need to
put TextBoxes to be databound to whatever's being selected in that ListView.
You need to have the TextBox area on a Panel that is docked to the bottom of
the form and the ListView is docked to Fill with a splitter in between them.

~~Bonnie


[quoted text, click to view]
A.M-SG
1/16/2006 11:32:21 AM
But pannel also does the same thing. Why not using pannel?


[quoted text, click to view]

Bonnie Berent [C# MVP]
1/16/2006 12:46:02 PM
You're welcome! =)

~~Bonnie



[quoted text, click to view]
A.M-SG
1/16/2006 12:59:48 PM
Thank you Bonnie.

[quoted text, click to view]

AddThis Social Bookmark Button