Share via


Form.ClientSize Properti

Definisi

Mendapatkan atau mengatur ukuran area klien formulir.

public:
 property System::Drawing::Size ClientSize { System::Drawing::Size get(); void set(System::Drawing::Size value); };
public System.Drawing.Size ClientSize { get; set; }
member this.ClientSize : System.Drawing.Size with get, set
Public Property ClientSize As Size

Nilai Properti

Size yang mewakili ukuran area klien formulir.

Contoh

Contoh berikut membuat penanganan aktivitas untuk Resize peristiwa formulir. Penanganan aktivitas menggunakan ClientSize properti formulir untuk membuat Button kontrol bernama button1 isi seluruh area klien formulir.

private:
   void MyForm_Resize( Object^ sender, EventHandler^ e )
   {
      // Set the size of button1 to the size of the client area of the form.
      button1->Size = this->ClientSize;
   }
private void MyForm_Resize (Object sender, EventHandler e)
 {
    // Set the size of button1 to the size of the client area of the form.
    button1.Size = this.ClientSize;
 }
Private Sub MyForm_Resize(sender As Object, e As EventHandler)
    ' Set the size of button1 to the size of the client area of the form.
    button1.Size = Me.ClientSize
End Sub

Keterangan

Ukuran area klien formulir adalah ukuran formulir yang tidak termasuk batas dan bilah judul. Area klien formulir adalah area dalam bentuk di mana kontrol dapat ditempatkan. Anda dapat menggunakan properti ini untuk mendapatkan dimensi yang tepat saat melakukan operasi grafis atau saat mengubah ukuran dan memosisikan kontrol pada formulir. Untuk mendapatkan ukuran seluruh formulir, gunakan Size properti atau gunakan properti Height individual dan Width.

Catatan

Saat ini Anda tidak dapat mengikat properti ini menggunakan pengaturan aplikasi. Untuk informasi selengkapnya tentang pengaturan aplikasi, lihat Gambaran Umum Pengaturan Aplikasi.

Berlaku untuk

Lihat juga