Control.Padding 属性

定义

获取或设置控件内的空白。Gets or sets padding within the control.

public:
 property System::Windows::Forms::Padding Padding { System::Windows::Forms::Padding get(); void set(System::Windows::Forms::Padding value); };
public System.Windows.Forms.Padding Padding { get; set; }
member this.Padding : System.Windows.Forms.Padding with get, set
Public Property Padding As Padding

属性值

Padding

表示控件的内部间距特征的 PaddingA Padding representing the control's internal spacing characteristics.

注解

对于和等容器 GroupBox TabControlPadding 属性获取或设置其各自的 DisplayRectangle 属性。For containers such as GroupBox and TabControl, the Padding property gets or sets their respective DisplayRectangle properties. ScrollableControl.DockPadding属性等于其 Control.Padding 属性。The ScrollableControl.DockPadding property is equal to its Control.Padding property.

控件接收的默认值 Padding 相当接近 Windows 用户界面准则。Controls receive default values for Padding that are reasonably close to Windows user interface guidelines. 有些调整对于特定的应用程序可能仍然是必需的。Some adjustments might still be necessary for particular applications.

当为时,所有实现的控件 GetPreferredSize 都按数量放大 Padding AutoSize trueAll controls that implement GetPreferredSize are enlarged by the amount in Padding when AutoSize is true.

以下控件不使用 PaddingThe following controls do not use Padding:

适用于