System.Windows.Forms.Panel Class

Used to group collections of controls.

See Also: Panel Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)]
[System.ComponentModel.Designer("System.Windows.Forms.Design.PanelDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.DefaultEvent("Paint")]
[System.ComponentModel.DefaultProperty("BorderStyle")]
public class Panel : ScrollableControl

Remarks

A System.Windows.Forms.Panel is a control that contains other controls. You can use a System.Windows.Forms.Panel to group collections of controls such as a group of System.Windows.Forms.RadioButton controls. As with other container controls such as the System.Windows.Forms.GroupBox control, if the System.Windows.Forms.Panel control's Control.Enabled property is set to false, the controls contained within the System.Windows.Forms.Panel will also be disabled.

The System.Windows.Forms.Panel control is displayed by default without any borders. You can provide a standard or three-dimensional border using the Panel.BorderStyle property to distinguish the area of the panel from other areas on the form. Because the System.Windows.Forms.Panel control derives from the System.Windows.Forms.ScrollableControl class, you can use the ScrollableControl.AutoScroll property to enable scroll bars in the System.Windows.Forms.Panel control. When the ScrollableControl.AutoScroll property is set to true, any controls located within the System.Windows.Forms.Panel (but outside of its visible region), can be scrolled to with the scroll bars provided.

The System.Windows.Forms.Panel control does not display a caption. If you need a control similar to a System.Windows.Forms.Panel that can display a caption, see the System.Windows.Forms.GroupBox control.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0