Form.SetDesktopBounds メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Form.SetDesktopBounds メソッドの意味・解説 

Form.SetDesktopBounds メソッド

フォーム範囲デスクトップ座標設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub SetDesktopBounds ( _
    x As Integer, _
    y As Integer, _
    width As Integer, _
    height As Integer _
)
Dim instance As Form
Dim x As Integer
Dim y As Integer
Dim width As Integer
Dim height As Integer

instance.SetDesktopBounds(x, y, width, height)
public void SetDesktopBounds (
    int x,
    int y,
    int width,
    int height
)
public:
void SetDesktopBounds (
    int x, 
    int y, 
    int width, 
    int height
)
public void SetDesktopBounds (
    int x, 
    int y, 
    int width, 
    int height
)
public function SetDesktopBounds (
    x : int, 
    y : int, 
    width : int, 
    height : int
)

パラメータ

x

フォーム位置x 座標

y

フォーム位置y 座標

width

フォームの幅。

height

フォームの高さ。

解説解説
使用例使用例

SetDesktopBounds メソッド使用するコード例次に示します。この例を実行するには、Button2 という名前のボタン配置されているフォームに、次のコード貼り付けます。必ずすべてのイベントイベント ハンドラ関連付けるようにしてください

Private Sub Button2_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button2.Click
    Dim i As Integer
    For i = 0 To 20
        ' With each loop through the code, the form's desktop location
 is 
        ' adjusted right and down by 10 pixels and its height and width
 
        ' are each decreased by 10 pixels. 
        Me.SetDesktopBounds(Me.Location.X +
 10, Me.Location.Y + 10, _
            Me.Width - 10, Me.Height - 10)

        ' Call Sleep to show the form gradually shrinking.
        System.Threading.Thread.Sleep(50)
    Next
End Sub
private void Button2_Click(System.Object sender,
 System.EventArgs e)
{
    
    for(int i = 0; i <= 20; i++)
    {
        // With each loop through the code, the form's 
        // desktop location is adjusted right and down
        //  by 10 pixels and its height and width are each
        // decreased by 10 pixels. 
        this.SetDesktopBounds(this.Location.X+10,
 
            this.Location.Y+10, this.Width-10,
 this.Height-10);

        // Call Sleep to show the form gradually shrinking.
        System.Threading.Thread.Sleep(50);
    }
}
void Button2_Click( System::Object^ sender, System::EventArgs^
 e )
{
   for ( int i = 0; i <= 20; i++ )
   {
      
      // With each loop through the code, the form's 
      // desktop location is adjusted right and down
      //  by 10 pixels and its height and width are each
      // decreased by 10 pixels. 
      this->SetDesktopBounds( this->Location.X
 + 10, this->Location.Y + 10, this->Width
 - 10, this->Height - 10 );
      
      // Call Sleep to show the form gradually shrinking.
      System::Threading::Thread::Sleep( 50 );

   }
}
private void button2_Click(Object sender, System.EventArgs
 e)
{
    for (int i = 0; i <= 20; i++) {
        // With each loop through the code, the form's 
        // desktop location is adjusted right and down
        // by 10 pixels and its height and width are each
        // decreased by 10 pixels. 
        this.SetDesktopBounds(this.get_Location().get_X()
 + 10, 
            this.get_Location().get_Y() + 10, this.get_Width()
 - 10, 
            this.get_Height() - 10);
        // Call Sleep to show the form gradually shrinking.
        System.Threading.Thread.Sleep(50);
    }
} //button2_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からForm.SetDesktopBounds メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からForm.SetDesktopBounds メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からForm.SetDesktopBounds メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Form.SetDesktopBounds メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Form.SetDesktopBounds メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS