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

属性值

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

注解

对于 GroupBoxTabControl 等容器,Padding 属性获取或设置其各自的 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.

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

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

适用于