Control.Padding 屬性


取得或設定控制項內的邊框間距。Gets or sets padding within the control.

 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,表示控制項的內部間距特性。A 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: