Control.SetClientSizeCore メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


クライアント領域は (0, 0) の位置から開始し、(x , y) の位置まで拡張します。
通常、コントロールの ClientSize は設定しないでください。
継承時の注意 派生クラスで SetClientSizeCore をオーバーライドする場合は、基本クラスの SetClientSizeCore メソッドを呼び出して、ClientSize プロパティを調整してください。 コントロール上の描画については、「Windows フォーム コントロールのレンダリング」を参照してください。
SetClientSizeCore メソッドをオーバーライドして、コントロールを正方形に保つコード例を次に示します。この例では、Control クラスから直接的または間接的に派生したクラスが存在している必要があります。
Protected Overrides Sub SetClientSizeCore(x As Integer, y As Integer) ' Keep the client size square. If x > y Then MyBase.SetClientSizeCore(x, x) Else MyBase.SetClientSizeCore(y, y) End If End Sub
protected override void SetClientSizeCore(int x, int y) { // Keep the client size square. if(x > y) { base.SetClientSizeCore(x, x); } else { base.SetClientSizeCore(y, y); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Control.SetClientSizeCore メソッドのページへのリンク