views:

686

answers:

2

Aren't both doing the same thing? How is each different from the other in case of the windows forms application.

+6  A: 

Apart from the appearance, Panel is Scrollable whereas GroupBox isn't, and GroupBox has a caption, whereas a Panel doesn't.

Patrick McDonald
is that all to it?
Anirudh Goel
That's pretty much it alright, they're both containers, and both function the same without borders, captions or scrollbars
Patrick McDonald
A: 

panels and group boxes are the same in that they are both containers. However panels can be thought of more as a form within a form, while a group box should be considered when placing like items in one spot. For instance if you have three radio buttons that alter the same function, it's best to put that in a group box. If you want to add a set of controls to an existing form but don't want to stretch or clutter your form, it's best to add those controls to a panel and work from there.

justin g
as for radio buttons we can group them together and they will work without a groupbox. For docking i think both work the same..
Anirudh Goel
yah, no sh*t you can use radios w/o a groupbox. Your question asked what is different about the two. One is primarily used for grouping while the other is primarily used to make your windows forms more robust, easy to use, and readable.
justin g