Form.DesktopLocation Özellik

Tanım

Formun Windows masaüstündeki konumunu alır veya ayarlar.

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

Özellik Değeri

Point Formun masaüstündeki konumunu temsil eden bir.

Öznitelikler

Örnekler

Aşağıdaki örnek, formun konumunu, formun masaüstünün sol kenarından 100 piksel ve masaüstünün üst kısmından 100 piksel konumlandırılması için ayarlar. Bu örnek, yöntemin bir form sınıfı içinde tanımlanmasını gerektirir.

public:
   void MoveMyForm()
   {
      // Create a Point object that will be used as the location of the form.
      Point tempPoint = Point( 100, 100 );
      // Set the location of the form using the Point object.
      this->DesktopLocation = tempPoint;
   }
public void MoveMyForm()
 {
    // Create a Point object that will be used as the location of the form.
    Point tempPoint = new Point(100,100);
    // Set the location of the form using the Point object.
    this.DesktopLocation = tempPoint;
 }
Public Sub MoveMyForm()
    ' Create a Point object that will be used as the location of the form.
    Dim tempPoint As New Point(100, 100)
    ' Set the location of the form using the Point object.
    DesktopLocation = tempPoint
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 çok eşli bir sistemde çalışıyorsa, formun koordinatları birleştirilmiş masaüstünün koordinatlarıdır.

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

yöntemini çağırmadan önce yöntemini çağırırsanız SetDesktopLocationShow , formunuz işletim sistemi tarafından belirlenen varsayılan konumuna konumlandırılır. Pencere konumlandırma hakkında daha fazla bilgi için "Pencere Özellikleri" makalesinin Pencere Boyutu ve Konum bölümüne bakın.

çağrısı SetDesktopLocationyaptıktan sonra ararsanız Show formunuz belirttiğiniz konuma konumlandırılır.

Şunlara uygulanır

Ayrıca bkz.