NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ScrollableControl.DockPadding

Gets the dock padding settings for all edges of the control.

[Visual Basic]
Overridable Public ReadOnly Property DockPadding As _
   ScrollableControl.DockPaddingEdges
[C#]
public ScrollableControl.DockPaddingEdges DockPadding {virtual
   get;}
[C++]
public: __property virtual ScrollableControl.DockPaddingEdges*
   get_DockPadding();
[JScript]
public function get DockPadding() :
   ScrollableControl.DockPaddingEdges;

Property Value

A ScrollableControl.DockPaddingEdges object that represents the padding for all the edges of a docked control.

Remarks

This property controls the border inside of this control for docked components.

Example [Visual Basic]

The following example uses the derived class, Panel. The example docks a button in a panel control and cycles through the System.WinForms.ScrollableControl$DockPaddingEdges properties setting another on each click of the button. This code assumes a Panel control and a Button have been instantiated on a form. This code shold be called on the OnClick event of the button.

[Visual Basic]

Private Sub MySub()
   ' Create a static integer variable.
   Static Dim myCounter As Integer

   ' Dock the button in the panel.
   Button1.Dock = System.WinForms.DockStyle.Fill
   
   ' Reset the counter if it is greater than 5.
   If myCounter > 5 Then
      myCounter = 0
   End If

   ' Set the appropriate DockPadding and display
   ' which one was set on the button face.
   Select Case myCounter
      Case 0
         Panel1.DockPadding.All = 0
         Button1.Text = "Start"
      Case 1
         Panel1.DockPadding.Top = 10
         Button1.Text = "Top"
      Case 2
         Panel1.DockPadding.Bottom = 10
         Button1.Text = "Bottom"
      Case 3
         Panel1.DockPadding.Left = 10
         Button1.Text = "Left"
      Case 4
         Panel1.DockPadding.Right = 10
         Button1.Text = "Right"
      Case 5
         Panel1.DockPadding.All = 20
         Button1.Text = "All"
   End Select
   
   ' Increment the counter.
   myCounter = myCounter + 1
End Sub

See Also

ScrollableControl Class | ScrollableControl Members | System.WinForms Namespace