FlowDirection 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 konstanta yang menentukan arah di mana elemen antarmuka pengguna (UI) berturut-turut ditempatkan dalam kontainer tata letak linier.
public enum class FlowDirection
public enum FlowDirection
type FlowDirection =
Public Enum FlowDirection
- Warisan
Bidang
| Nama | Nilai | Deskripsi |
|---|---|---|
| LeftToRight | 0 | Elemen mengalir dari tepi kiri permukaan desain ke kanan. |
| TopDown | 1 | Elemen mengalir dari bagian atas permukaan desain ke bagian bawah. |
| RightToLeft | 2 | Elemen mengalir dari tepi kanan permukaan desain ke kiri. |
| BottomUp | 3 | Elemen mengalir dari bagian bawah permukaan desain ke bagian atas. |
Contoh
Contoh berikut menunjukkan cara mengatur FlowDirection properti pada FlowLayoutPanel kontrol. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk FlowLayoutPanel kontrol.
private:
void flowTopDownBtn_CheckedChanged(System::Object^ sender,
System::EventArgs^ e)
{
this->flowLayoutPanel1->FlowDirection = FlowDirection::TopDown;
}
private:
void flowBottomUpBtn_CheckedChanged(System::Object^ sender,
System::EventArgs^ e)
{
this->flowLayoutPanel1->FlowDirection = FlowDirection::BottomUp;
}
private:
void flowLeftToRight_CheckedChanged(System::Object^ sender,
System::EventArgs^ e)
{
this->flowLayoutPanel1->FlowDirection =
FlowDirection::LeftToRight;
}
private:
void flowRightToLeftBtn_CheckedChanged(
System::Object^ sender, System::EventArgs^ e)
{
this->flowLayoutPanel1->FlowDirection =
FlowDirection::RightToLeft;
}
private void flowTopDownBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
}
private void flowBottomUpBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp;
}
private void flowLeftToRight_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
}
private void flowRightToLeftBtn_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft;
}
Private Sub flowTopDownBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowTopDownBtn.CheckedChanged
Me.FlowLayoutPanel1.FlowDirection = FlowDirection.TopDown
End Sub
Private Sub flowBottomUpBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowBottomUpBtn.CheckedChanged
Me.FlowLayoutPanel1.FlowDirection = FlowDirection.BottomUp
End Sub
Private Sub flowLeftToRight_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowLeftToRight.CheckedChanged
Me.FlowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight
End Sub
Private Sub flowRightToLeftBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles flowRightToLeftBtn.CheckedChanged
Me.FlowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft
End Sub
Keterangan
FlowDirection Enumerasi menjelaskan arah alur elemen UI berturut-turut, biasanya mengontrol, pada permukaan desain atau kontainer seperti formulir. Enumerasi ini digunakan oleh kontainer tata letak linier seperti FlowLayoutPanel, yang menyimpan informasi ini secara internal dalam FlowLayoutPanel.FlowDirection properti.
FlowDirection menentukan di mana kontrol baru ditempatkan secara default saat ditambahkan ke kontainer pendukung. Arah alur kontainer, bersama dengan Anchor properti dan Dock dari setiap kontrol yang terkandung, menentukan pengaturan ulang kontrol saat kontainernya diubah ukurannya.
Kontrol FlowLayoutPanel menyediakan FlowBreak properti untuk kontrol turunannya. Mengatur nilai FlowBreak properti untuk true menyebabkan FlowLayoutPanel kontrol berhenti meletakkan kontrol ke arah alur saat ini dan membungkus ke baris atau kolom berikutnya.