FormBorderStyle Enum
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menentukan gaya batas untuk formulir.
public enum class FormBorderStyle
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormBorderStyle
public enum FormBorderStyle
[<System.Runtime.InteropServices.ComVisible(true)>]
type FormBorderStyle =
type FormBorderStyle =
Public Enum FormBorderStyle
- Warisan
- Atribut
Bidang
| Nama | Nilai | Deskripsi |
|---|---|---|
| None | 0 | Tidak ada batas. |
| FixedSingle | 1 | Batas tetap satu baris. |
| Fixed3D | 2 | Batas tiga dimensi tetap. |
| FixedDialog | 3 | Batas gaya dialog tebal dan tetap. |
| Sizable | 4 | Batas yang dapat diubah besar. |
| FixedToolWindow | 5 | Batas jendela alat yang tidak dapat diubah ukurannya. Jendela alat tidak muncul di taskbar atau di jendela yang muncul saat pengguna menekan ALT+TAB. Meskipun formulir yang menentukan FixedToolWindow biasanya tidak ditampilkan di taskbar, Anda juga harus memastikan bahwa ShowInTaskbar properti diatur ke |
| SizableToolWindow | 6 | Batas jendela alat yang dapat diubah ukurannya. Jendela alat tidak muncul di taskbar atau di jendela yang muncul saat pengguna menekan ALT+TAB. |
Contoh
Dalam contoh ini, Anda mengubah gaya batas formulir menjadi Fixed3d dan menampilkan informasi batas menggunakan label. Contoh ini mengasumsikan bahwa Anda telah membuat Form bernama Form1.
public:
void InitMyForm()
{
// Adds a label to the form.
Label^ label1 = gcnew Label;
label1->Location = System::Drawing::Point( 80, 80 );
label1->Name = "label1";
label1->Size = System::Drawing::Size( 132, 80 );
label1->Text = "Start Position Information";
this->Controls->Add( label1 );
// Changes the border to Fixed3D.
FormBorderStyle = ::FormBorderStyle::Fixed3D;
// Displays the border information.
label1->Text = String::Format( "The border is {0}", FormBorderStyle );
}
public void InitMyForm()
{
// Adds a label to the form.
Label label1 = new Label();
label1.Location = new System.Drawing.Point(80,80);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(132,80);
label1.Text = "Start Position Information";
this.Controls.Add(label1);
// Changes the border to Fixed3D.
FormBorderStyle = FormBorderStyle.Fixed3D;
// Displays the border information.
label1.Text = "The border is " + FormBorderStyle;
}
Public Sub InitMyForm()
' Adds a label to the form.
Dim label1 As New Label()
label1.Location = New System.Drawing.Point(80, 80)
label1.Name = "label1"
label1.Size = New System.Drawing.Size(132, 80)
label1.Text = "Start Position Information"
Me.Controls.Add(label1)
' Changes the border to Fixed3D.
FormBorderStyle = FormBorderStyle.Fixed3D
' Displays the border information.
label1.Text = "The border is " + FormBorderStyle
End Sub
Keterangan
Enumerasi ini digunakan oleh Form kelas . Ini mewakili berbagai gaya formulir. Gaya defaultnya adalah Sizable.