Control.SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) メソッド

定義

このコントロールの指定した境界を設定する作業を実行します。

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)

パラメーター

x
Int32

コントロールの新しい Left プロパティ値。

y
Int32

コントロールの新しい Top プロパティ値。

width
Int32

コントロールの新しい Width プロパティ値。

height
Int32

コントロールの新しい Height プロパティ値。

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 まれていない境界に対応するパラメーターは、現在の値と共に渡されます。 たとえば、プロパティの HeightWidth、またはXYプロパティは、コントロールのLocation現在のインスタンスへの参照と共に渡すことができます。 ただし、渡されるすべての値が優先され、コントロールに適用されます。

このパラメーターは boundsSpecified 、アプリケーションによって変更されたコントロールの Bounds 要素を表します。 たとえば、コントロールの値をSize変更した場合、パラメーターのboundsSpecifiedBoundsSpecifiedSize . ただし、設定されているプロパティに応じて調整される場合SizeboundsSpecifiedパラメーター値は None BoundsSpecified.Dock

注意

Windows Server 2003 システムでは、a Form のサイズはモニターの最大ピクセル幅と高さによって制限されます。

注意 (継承者)

派生クラスでオーバーライドする SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 場合は、必ず基底クラスの SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) メソッドを呼び出して、コントロールの境界を強制的に変更してください。 派生クラスは、メソッドにサイズ制限を SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified) 追加できます。

適用対象

こちらもご覧ください