ScrollableControl.DockPaddingEdges クラス
定義
ドッキングされたコントロールの境界の埋め込みを決定します。Determines the border padding for docked controls.
public: ref class ScrollableControl::DockPaddingEdges : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.ScrollableControl/DockPaddingEdgesConverter))]
public class ScrollableControl.DockPaddingEdges : ICloneable
type ScrollableControl.DockPaddingEdges = class
interface ICloneable
Public Class ScrollableControl.DockPaddingEdges
Implements ICloneable
- 継承
-
ScrollableControl.DockPaddingEdges
- 属性
- 実装
例
次のコード例では、派生クラスを使用して Panel です。The following code example uses the derived class, Panel. この例では、panel コントロールにボタンをドッキングし、ScrollableControl.DockPaddingEdges プロパティを順番に切り替えて、ボタンをクリックしてそれぞれを個別に設定します。The example docks a button in a panel control and cycles through the ScrollableControl.DockPaddingEdges properties, setting each individually on the click of the button. このコードでは、@no__t 0 コントロールと Button がフォームでインスタンス化されており、myCounter
というクラスレベルのメンバー変数が32ビット符号付き整数として宣言されている必要があります。This code requires that a Panel control and a Button have been instantiated on a form, and a class-level member variable named myCounter
has been declared as a 32-bit signed integer. このコードは、ボタンの @no__t 0 イベントで呼び出す必要があります。This code should be called on the Click event of the button.
void SetDockPadding()
{
// Dock the button in the panel.
button1->Dock = System::Windows::Forms::DockStyle::Fill;
// Reset the counter if it is greater than 5.
if ( myCounter > 5 )
{
myCounter = 0;
}
/* Set the appropriate DockPadding and display
which one was set on the button face. */
switch ( myCounter )
{
case 0:
panel1->DockPadding->All = 0;
button1->Text = "Start";
break;
case 1:
panel1->DockPadding->Top = 10;
button1->Text = "Top";
break;
case 2:
panel1->DockPadding->Bottom = 10;
button1->Text = "Bottom";
break;
case 3:
panel1->DockPadding->Left = 10;
button1->Text = "Left";
break;
case 4:
panel1->DockPadding->Right = 10;
button1->Text = "Right";
break;
case 5:
panel1->DockPadding->All = 20;
button1->Text = "All";
break;
}
myCounter++;
}
private void SetDockPadding()
{
// Dock the button in the panel.
button1.Dock = System.Windows.Forms.DockStyle.Fill;
// Reset the counter if it is greater than 5.
if (myCounter > 5)
{
myCounter = 0;
}
/* Set the appropriate DockPadding and display
which one was set on the button face. */
switch (myCounter)
{
case 0:
panel1.DockPadding.All = 0;
button1.Text = "Start";
break;
case 1:
panel1.DockPadding.Top = 10;
button1.Text = "Top";
break;
case 2:
panel1.DockPadding.Bottom = 10;
button1.Text = "Bottom";
break;
case 3:
panel1.DockPadding.Left = 10;
button1.Text = "Left";
break;
case 4:
panel1.DockPadding.Right = 10;
button1.Text = "Right";
break;
case 5:
panel1.DockPadding.All = 20;
button1.Text = "All";
break;
}
// Increment the counter.
myCounter += 1;
}
Private Sub SetDockPadding()
' Dock the button in the panel.
button1.Dock = System.Windows.Forms.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 += 1
End Sub
注釈
@No__t-0 クラスは、特定のエッジまたはドッキングされたコントロールのすべての端に余白を作成します。The ScrollableControl.DockPaddingEdges class creates a margin on a given edge or all edges of a docked control. 個々のエッジに対してこの余白の幅を設定するには、Bottom、Top、Left、Right の各プロパティを設定します。You can set the width of this margin for each individual edge by setting the following properties: Bottom, Top, Left, Right. または、All プロパティを設定して、すべての端を同時に同じ幅に設定することもできます。Alternatively, you can set all the edges to the same width simultaneously by setting the All property. コントロールのサイズが大きすぎてコンテナーに対して大きすぎる場合、コントロールは、コンテナーに合わせてサイズが変更され、指定された余白幅を差し引いたものになります。If the size of the control is too large for its container, the control will be resized to fit in the container, minus the specified margin width.
プロパティ
All |
ドッキングされたコントロールのすべての端の埋め込み幅を取得または設定します。Gets or sets the padding width for all edges of a docked control. |
Bottom |
ドッキングされたコントロールの下端の埋め込み幅を取得または設定します。Gets or sets the padding width for the bottom edge of a docked control. |
Left |
ドッキングされたコントロールの左端の埋め込み幅を取得または設定します。Gets or sets the padding width for the left edge of a docked control. |
Right |
ドッキングされたコントロールの右端の埋め込み幅を取得または設定します。Gets or sets the padding width for the right edge of a docked control. |
Top |
ドッキングされたコントロールの上端の埋め込み幅を取得または設定します。Gets or sets the padding width for the top edge of a docked control. |
メソッド
Equals(Object) |
指定したオブジェクトが、現在の ScrollableControl.DockPaddingEdges オブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current ScrollableControl.DockPaddingEdges object. |
GetHashCode() |
特定の型のハッシュ関数として機能します。Serves as a hash function for a particular type. |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
ToString() |
空の文字列を返します。Returns an empty string. |
明示的なインターフェイスの実装
ICloneable.Clone() |
現在のインスタンスのコピーである新しいオブジェクトを作成します。Creates a new object that is a copy of the current instance. |