Windows Forms Panel controls are used to provide an identifiable grouping for other controls. Typically, you use panels to subdivide a form by function. For example, you may have an order form that specifies mailing options such as which overnight carrier to use. Grouping all options in a panel gives the user a logical visual cue. At design time all the controls can be moved easily — when you move the Panel control, all its contained controls move, too. The controls grouped in a panel can be accessed through its Controls property. This property returns a collection of Control instances, so you will typically need to cast a control retrieved this way to its specific type.

Panel Versus GroupBox
The Panel control is similar to the GroupBox control; however, only the Panel control can have scroll bars, and only the GroupBox control displays a caption.

Key Properties

See Also