Control.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
このコントロールの指定された境界を設定する処理を実行します。
protected:
virtual void SetBoundsCore(int x, int y, int width, int height, System::Windows::Forms::BoundsSpecified specified);
protected virtual void SetBoundsCore(int x, int y, int width, int height, System.Windows.Forms.BoundsSpecified specified);
abstract member SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -> unit
override this.SetBoundsCore : int * int * int * int * System.Windows.Forms.BoundsSpecified -> unit
Protected Overridable Sub SetBoundsCore (x As Integer, y As Integer, width As Integer, height As Integer, specified As BoundsSpecified)
パラメーター
- specified
- BoundsSpecified
BoundsSpecified値のビットごとの組み合わせ。
例
次のコード例では、コントロールが固定サイズのままになるように、 SetBoundsCore メソッドをオーバーライドします。 この例では、 Control クラスから直接または間接的に派生するクラスが必要です。
protected:
virtual void SetBoundsCore( int x, int y, int width, int height, BoundsSpecified specified ) override
{
// Set a fixed height and width for the control.
UserControl::SetBoundsCore( x, y, 150, 75, specified );
}
protected override void SetBoundsCore(int x, int y,
int width, int height, BoundsSpecified specified)
{
// Set a fixed height and width for the control.
base.SetBoundsCore(x, y, 150, 75, specified);
}
Protected Overrides Sub SetBoundsCore(x As Integer, _
y As Integer, width As Integer, _
height As Integer, specified As BoundsSpecified)
' Set a fixed height and width for the control.
MyBase.SetBoundsCore(x, y, 150, 75, specified)
End Sub
注釈
通常、 specified パラメーターに含まれていない境界に対応するパラメーターは、現在の値と共に渡されます。 たとえば、Height プロパティのWidth、X、またはYプロパティまたはLocationプロパティを、コントロールの現在のインスタンスへの参照と共に渡すことができます。 ただし、渡されるすべての値が優先され、コントロールに適用されます。
boundsSpecified パラメーターは、アプリケーションによって変更Boundsコントロールの要素を表します。 たとえば、コントロールのSizeを変更した場合、boundsSpecified パラメーターの値はSizeのBoundsSpecified値になります。 ただし、Sizeが設定されているDockプロパティに応じて調整される場合、boundsSpecified パラメーター値はNoneのBoundsSpecified値です。
Note
Windows Server 2003 システムでは、 Form のサイズはモニターの最大ピクセル幅と高さによって制限されます。
注意 (継承者)
派生クラスの SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) をオーバーライドする場合は、必ず基底クラスの SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) メソッドを呼び出して、コントロールの境界を強制的に変更してください。 派生クラスは、 SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) メソッドにサイズ制限を追加できます。