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

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

Öznitelikler

Örnekler

Aşağıdaki örnek, formun konumunu, masaüstünün sol kenarlarından 100 piksel ve masaüstünün üstünden 100 piksel olacak şekilde 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 işlemcili bir sistemde çalışıyorsa, formun koordinatları birleşik masaüstü için koordinatlardı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 SetDesktopLocation Show , 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 Konumu bölümüne bakın.

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

Şunlara uygulanır

Ayrıca bkz.