Share via


Form.DesktopBounds Özellik

Tanım

Windows masaüstünde formun boyutunu ve konumunu alır veya ayarlar.

public:
 property System::Drawing::Rectangle DesktopBounds { System::Drawing::Rectangle get(); void set(System::Drawing::Rectangle value); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Rectangle DesktopBounds { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.DesktopBounds : System.Drawing.Rectangle with get, set
Public Property DesktopBounds As Rectangle

Özellik Değeri

Rectangle Masaüstü koordinatlarını kullanarak Windows masaüstünde formun sınırlarını temsil eden bir.

Öznitelikler

Örnekler

Aşağıdaki örnek, formun boyutunu ve konumunu, formun masaüstünün sol kenarlarından 50 piksel ve masaüstünün en üstünden 50 piksel olacak şekilde ayarlar. Bu örnek, yönteminin bir form sınıfı içinde tanımlanmasını gerektirir.

public:
   void MoveMyForm()
   {
      // Create a Rectangle object that will be used as the bound of the form.
      Rectangle tempRect = Rectangle( 50, 50, 100, 100 );
      // Set the bounds of the form using the Rectangle object.
      this->DesktopBounds = tempRect;
   }
public void MoveMyForm()
 {
    // Create a Rectangle object that will be used as the bound of the form.
    Rectangle tempRect = new Rectangle(50,50,100,100);
    //  Set the bounds of the form using the Rectangle object.
    this.DesktopBounds = tempRect;
 }
Public Sub MoveMyForm()
    ' Create a Rectangle object that will be used as the bound of the form.
    Dim tempRect As New Rectangle(50, 50, 100, 100)
    '  Set the bounds of the form using the Rectangle object.
    DesktopBounds = tempRect
End Sub

Açıklamalar

Masaüstü koordinatları, görev çubuğunu dışlayan ekranın çalışma alanını temel alır. Masaüstünün koordinat sistemi piksel tabanlıdır. Uygulamanız birden çok monitör sisteminde çalışıyorsa, formun koordinatları birleşik masaüstünün koordinatlarıdır.

Bir formu Windows masaüstündeki diğer formlara veya uygulamalara göre boyutlandırmak ve konumlandırmak için bu özelliği kullanabilirsiniz.

Şunlara uygulanır

Ayrıca bkz.