FlowLayoutPanel 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示以水平或垂直方式动态布置其内容的面板。
public ref class FlowLayoutPanel : System::Windows::Forms::Panel, System::ComponentModel::IExtenderProvider
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)]
public class FlowLayoutPanel : System.Windows.Forms.Panel, System.ComponentModel.IExtenderProvider
[System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)]
public class FlowLayoutPanel : System.Windows.Forms.Panel, System.ComponentModel.IExtenderProvider
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)>]
type FlowLayoutPanel = class
inherit Panel
interface IExtenderProvider
[<System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.Ask)>]
type FlowLayoutPanel = class
inherit Panel
interface IExtenderProvider
Public Class FlowLayoutPanel
Inherits Panel
Implements IExtenderProvider
- 继承
- 属性
- 实现
示例
以下示例演示如何在控件上FlowLayoutPanel设置 FlowDirection 和 WrapContents 属性。 将代码粘贴到 Form1 源文件中。 如果项目包含名为 Form1 的文件。Designer.cs或 Form1。Designer.vb,从项目中删除该文件。 可能需要单击 解决方案资源管理器 中的“显示所有文件”按钮才能查看设计器文件。
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>
using namespace System;
using namespace System::Windows::Forms;
public ref class Form1 : public System::Windows::Forms::Form
{
private:
void wrapContentsCheckBox_CheckedChanged(
System::Object^ sender, System::EventArgs^ e)
{
this->flowLayoutPanel1->WrapContents =
this->wrapContentsCheckBox->Checked;
}
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;
}
#pragma region " Windows Form Designer generated code "
public:
Form1(void)
{
// This call is required by the Windows Form Designer.
InitializeComponent();
// Add any initialization after the InitializeComponent()
// call
}
// Form overrides dispose to clean up the component list.
protected:
~Form1()
{
if (components != nullptr)
{
delete components;
}
}
private:
System::Windows::Forms::FlowLayoutPanel^ flowLayoutPanel1;
private:
System::Windows::Forms::CheckBox^ wrapContentsCheckBox;
private:
System::Windows::Forms::RadioButton^ flowTopDownBtn;
private:
System::Windows::Forms::RadioButton^ flowBottomUpBtn;
private:
System::Windows::Forms::RadioButton^ flowLeftToRight;
private:
System::Windows::Forms::RadioButton^ flowRightToLeftBtn;
private:
System::Windows::Forms::Button^ button1;
private:
System::Windows::Forms::Button^ button2;
private:
System::Windows::Forms::Button^ button3;
private:
System::Windows::Forms::Button^ button4;
// Required by the Windows Form Designer
private:
System::ComponentModel::IContainer^ components;
// NOTE: The following procedure is required by the Windows Form
// Designer
// It can be modified using the Windows Form Designer.
// Do not modify it using the code editor.
private:
[System::Diagnostics::DebuggerNonUserCode]
void InitializeComponent()
{
this->flowLayoutPanel1 =
gcnew System::Windows::Forms::FlowLayoutPanel();
this->button1 = gcnew System::Windows::Forms::Button();
this->button2 = gcnew System::Windows::Forms::Button();
this->button3 = gcnew System::Windows::Forms::Button();
this->button4 = gcnew System::Windows::Forms::Button();
this->wrapContentsCheckBox =
gcnew System::Windows::Forms::CheckBox();
this->flowTopDownBtn = gcnew System::Windows::Forms::RadioButton();
this->flowBottomUpBtn =
gcnew System::Windows::Forms::RadioButton();
this->flowLeftToRight =
gcnew System::Windows::Forms::RadioButton();
this->flowRightToLeftBtn =
gcnew System::Windows::Forms::RadioButton();
this->flowLayoutPanel1->SuspendLayout();
this->SuspendLayout();
//
// flowLayoutPanel1
//
this->flowLayoutPanel1->Controls->Add(this->button1);
this->flowLayoutPanel1->Controls->Add(this->button2);
this->flowLayoutPanel1->Controls->Add(this->button3);
this->flowLayoutPanel1->Controls->Add(this->button4);
this->flowLayoutPanel1->Location =
System::Drawing::Point(47, 55);
this->flowLayoutPanel1->Name = "flowLayoutPanel1";
this->flowLayoutPanel1->TabIndex = 0;
//
// button1
//
this->button1->Location = System::Drawing::Point(3, 3);
this->button1->Name = "button1";
this->button1->TabIndex = 0;
this->button1->Text = "button1";
//
// button2
//
this->button2->Location = System::Drawing::Point(84, 3);
this->button2->Name = "button2";
this->button2->TabIndex = 1;
this->button2->Text = "button2";
//
// button3
//
this->button3->Location = System::Drawing::Point(3, 32);
this->button3->Name = "button3";
this->button3->TabIndex = 2;
this->button3->Text = "button3";
//
// button4
//
this->button4->Location = System::Drawing::Point(84, 32);
this->button4->Name = "button4";
this->button4->TabIndex = 3;
this->button4->Text = "button4";
//
// wrapContentsCheckBox
//
this->wrapContentsCheckBox->Location =
System::Drawing::Point(46, 162);
this->wrapContentsCheckBox->Name = "wrapContentsCheckBox";
this->wrapContentsCheckBox->TabIndex = 1;
this->wrapContentsCheckBox->Text = "Wrap Contents";
this->wrapContentsCheckBox->CheckedChanged +=
gcnew System::EventHandler(
this, &Form1::wrapContentsCheckBox_CheckedChanged);
//
// flowTopDownBtn
//
this->flowTopDownBtn->Location =
System::Drawing::Point(45, 193);
this->flowTopDownBtn->Name = "flowTopDownBtn";
this->flowTopDownBtn->TabIndex = 2;
this->flowTopDownBtn->Text = "Flow TopDown";
this->flowTopDownBtn->CheckedChanged +=
gcnew System::EventHandler(
this, &Form1::flowTopDownBtn_CheckedChanged);
//
// flowBottomUpBtn
//
this->flowBottomUpBtn->Location =
System::Drawing::Point(44, 224);
this->flowBottomUpBtn->Name = "flowBottomUpBtn";
this->flowBottomUpBtn->TabIndex = 3;
this->flowBottomUpBtn->Text = "Flow BottomUp";
this->flowBottomUpBtn->CheckedChanged +=
gcnew System::EventHandler(
this, &Form1::flowBottomUpBtn_CheckedChanged);
//
// flowLeftToRight
//
this->flowLeftToRight->Location =
System::Drawing::Point(156, 193);
this->flowLeftToRight->Name = "flowLeftToRight";
this->flowLeftToRight->TabIndex = 4;
this->flowLeftToRight->Text = "Flow LeftToRight";
this->flowLeftToRight->CheckedChanged +=
gcnew System::EventHandler(
this, &Form1::flowLeftToRight_CheckedChanged);
//
// flowRightToLeftBtn
//
this->flowRightToLeftBtn->Location =
System::Drawing::Point(155, 224);
this->flowRightToLeftBtn->Name = "flowRightToLeftBtn";
this->flowRightToLeftBtn->TabIndex = 5;
this->flowRightToLeftBtn->Text = "Flow RightToLeft";
this->flowRightToLeftBtn->CheckedChanged +=
gcnew System::EventHandler(
this, &Form1::flowRightToLeftBtn_CheckedChanged);
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->ClientSize = System::Drawing::Size(292, 266);
this->Controls->Add(this->flowRightToLeftBtn);
this->Controls->Add(this->flowLeftToRight);
this->Controls->Add(this->flowBottomUpBtn);
this->Controls->Add(this->flowTopDownBtn);
this->Controls->Add(this->wrapContentsCheckBox);
this->Controls->Add(this->flowLayoutPanel1);
this->Name = "Form1";
this->Text = "Form1";
this->flowLayoutPanel1->ResumeLayout(false);
this->ResumeLayout(false);
}
#pragma endregion
};
using System;
using System.Windows.Forms;
public class Form1 : System.Windows.Forms.Form
{
private void wrapContentsCheckBox_CheckedChanged(
System.Object sender,
System.EventArgs e)
{
this.FlowLayoutPanel1.WrapContents =
this.wrapContentsCheckBox.Checked;
}
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;
}
#region " Windows Form Designer generated code "
public Form1() : base()
{
//This call is required by the Windows Form Designer.
InitializeComponent();
//Add any initialization after the InitializeComponent() call
}
//Form overrides dispose to clean up the component list.
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
private System.Windows.Forms.FlowLayoutPanel FlowLayoutPanel1;
private System.Windows.Forms.CheckBox wrapContentsCheckBox;
private System.Windows.Forms.RadioButton flowTopDownBtn;
private System.Windows.Forms.RadioButton flowBottomUpBtn;
private System.Windows.Forms.RadioButton flowLeftToRight;
private System.Windows.Forms.RadioButton flowRightToLeftBtn;
private System.Windows.Forms.Button Button1;
private System.Windows.Forms.Button Button2;
private System.Windows.Forms.Button Button3;
private System.Windows.Forms.Button Button4;
//Required by the Windows Form Designer
private System.ComponentModel.IContainer components;
//NOTE: The following procedure is required by the Windows Form Designer
//It can be modified using the Windows Form Designer.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerNonUserCode]
private void InitializeComponent()
{
this.FlowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.Button1 = new System.Windows.Forms.Button();
this.Button2 = new System.Windows.Forms.Button();
this.Button3 = new System.Windows.Forms.Button();
this.Button4 = new System.Windows.Forms.Button();
this.wrapContentsCheckBox = new System.Windows.Forms.CheckBox();
this.flowTopDownBtn = new System.Windows.Forms.RadioButton();
this.flowBottomUpBtn = new System.Windows.Forms.RadioButton();
this.flowLeftToRight = new System.Windows.Forms.RadioButton();
this.flowRightToLeftBtn = new System.Windows.Forms.RadioButton();
this.FlowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// FlowLayoutPanel1
//
this.FlowLayoutPanel1.Controls.Add(this.Button1);
this.FlowLayoutPanel1.Controls.Add(this.Button2);
this.FlowLayoutPanel1.Controls.Add(this.Button3);
this.FlowLayoutPanel1.Controls.Add(this.Button4);
this.FlowLayoutPanel1.Location = new System.Drawing.Point(47, 55);
this.FlowLayoutPanel1.Name = "FlowLayoutPanel1";
this.FlowLayoutPanel1.TabIndex = 0;
//
// Button1
//
this.Button1.Location = new System.Drawing.Point(3, 3);
this.Button1.Name = "Button1";
this.Button1.TabIndex = 0;
this.Button1.Text = "Button1";
//
// Button2
//
this.Button2.Location = new System.Drawing.Point(84, 3);
this.Button2.Name = "Button2";
this.Button2.TabIndex = 1;
this.Button2.Text = "Button2";
//
// Button3
//
this.Button3.Location = new System.Drawing.Point(3, 32);
this.Button3.Name = "Button3";
this.Button3.TabIndex = 2;
this.Button3.Text = "Button3";
//
// Button4
//
this.Button4.Location = new System.Drawing.Point(84, 32);
this.Button4.Name = "Button4";
this.Button4.TabIndex = 3;
this.Button4.Text = "Button4";
//
// wrapContentsCheckBox
//
this.wrapContentsCheckBox.Location = new System.Drawing.Point(46, 162);
this.wrapContentsCheckBox.Name = "wrapContentsCheckBox";
this.wrapContentsCheckBox.TabIndex = 1;
this.wrapContentsCheckBox.Text = "Wrap Contents";
this.wrapContentsCheckBox.CheckedChanged += new System.EventHandler(this.wrapContentsCheckBox_CheckedChanged);
//
// flowTopDownBtn
//
this.flowTopDownBtn.Location = new System.Drawing.Point(45, 193);
this.flowTopDownBtn.Name = "flowTopDownBtn";
this.flowTopDownBtn.TabIndex = 2;
this.flowTopDownBtn.Text = "Flow TopDown";
this.flowTopDownBtn.CheckedChanged += new System.EventHandler(this.flowTopDownBtn_CheckedChanged);
//
// flowBottomUpBtn
//
this.flowBottomUpBtn.Location = new System.Drawing.Point(44, 224);
this.flowBottomUpBtn.Name = "flowBottomUpBtn";
this.flowBottomUpBtn.TabIndex = 3;
this.flowBottomUpBtn.Text = "Flow BottomUp";
this.flowBottomUpBtn.CheckedChanged += new System.EventHandler(this.flowBottomUpBtn_CheckedChanged);
//
// flowLeftToRight
//
this.flowLeftToRight.Location = new System.Drawing.Point(156, 193);
this.flowLeftToRight.Name = "flowLeftToRight";
this.flowLeftToRight.TabIndex = 4;
this.flowLeftToRight.Text = "Flow LeftToRight";
this.flowLeftToRight.CheckedChanged += new System.EventHandler(this.flowLeftToRight_CheckedChanged);
//
// flowRightToLeftBtn
//
this.flowRightToLeftBtn.Location = new System.Drawing.Point(155, 224);
this.flowRightToLeftBtn.Name = "flowRightToLeftBtn";
this.flowRightToLeftBtn.TabIndex = 5;
this.flowRightToLeftBtn.Text = "Flow RightToLeft";
this.flowRightToLeftBtn.CheckedChanged += new System.EventHandler(this.flowRightToLeftBtn_CheckedChanged);
//
// Form1
//
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.flowRightToLeftBtn);
this.Controls.Add(this.flowLeftToRight);
this.Controls.Add(this.flowBottomUpBtn);
this.Controls.Add(this.flowTopDownBtn);
this.Controls.Add(this.wrapContentsCheckBox);
this.Controls.Add(this.FlowLayoutPanel1);
this.Name = "Form1";
this.Text = "Form1";
this.FlowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
}
Imports System.Windows.Forms
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub wrapContentsCheckBox_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles wrapContentsCheckBox.CheckedChanged
Me.FlowLayoutPanel1.WrapContents = Me.wrapContentsCheckBox.Checked
End Sub
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
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If (components IsNot Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents wrapContentsCheckBox As System.Windows.Forms.CheckBox
Friend WithEvents flowTopDownBtn As System.Windows.Forms.RadioButton
Friend WithEvents flowBottomUpBtn As System.Windows.Forms.RadioButton
Friend WithEvents flowLeftToRight As System.Windows.Forms.RadioButton
Friend WithEvents flowRightToLeftBtn As System.Windows.Forms.RadioButton
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerNonUserCode()> Private Sub InitializeComponent()
Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel
Me.wrapContentsCheckBox = New System.Windows.Forms.CheckBox
Me.flowTopDownBtn = New System.Windows.Forms.RadioButton
Me.flowBottomUpBtn = New System.Windows.Forms.RadioButton
Me.flowLeftToRight = New System.Windows.Forms.RadioButton
Me.flowRightToLeftBtn = New System.Windows.Forms.RadioButton
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.FlowLayoutPanel1.SuspendLayout()
Me.SuspendLayout()
'
'FlowLayoutPanel1
'
Me.FlowLayoutPanel1.Controls.Add(Me.Button1)
Me.FlowLayoutPanel1.Controls.Add(Me.Button2)
Me.FlowLayoutPanel1.Controls.Add(Me.Button3)
Me.FlowLayoutPanel1.Controls.Add(Me.Button4)
Me.FlowLayoutPanel1.Location = New System.Drawing.Point(47, 55)
Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1"
Me.FlowLayoutPanel1.TabIndex = 0
'
'wrapContentsCheckBox
'
Me.wrapContentsCheckBox.Location = New System.Drawing.Point(46, 162)
Me.wrapContentsCheckBox.Name = "wrapContentsCheckBox"
Me.wrapContentsCheckBox.TabIndex = 1
Me.wrapContentsCheckBox.Text = "Wrap Contents"
'
'flowTopDownBtn
'
Me.flowTopDownBtn.Location = New System.Drawing.Point(45, 193)
Me.flowTopDownBtn.Name = "flowTopDownBtn"
Me.flowTopDownBtn.TabIndex = 2
Me.flowTopDownBtn.Text = "Flow TopDown"
'
'flowBottomUpBtn
'
Me.flowBottomUpBtn.Location = New System.Drawing.Point(44, 224)
Me.flowBottomUpBtn.Name = "flowBottomUpBtn"
Me.flowBottomUpBtn.TabIndex = 3
Me.flowBottomUpBtn.Text = "Flow BottomUp"
'
'flowLeftToRight
'
Me.flowLeftToRight.Location = New System.Drawing.Point(156, 193)
Me.flowLeftToRight.Name = "flowLeftToRight"
Me.flowLeftToRight.TabIndex = 4
Me.flowLeftToRight.Text = "Flow LeftToRight"
'
'flowRightToLeftBtn
'
Me.flowRightToLeftBtn.Location = New System.Drawing.Point(155, 224)
Me.flowRightToLeftBtn.Name = "flowRightToLeftBtn"
Me.flowRightToLeftBtn.TabIndex = 5
Me.flowRightToLeftBtn.Text = "Flow RightToLeft"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(3, 3)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(84, 3)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 1
Me.Button2.Text = "Button2"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(3, 32)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 2
Me.Button3.Text = "Button3"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(84, 32)
Me.Button4.Name = "Button4"
Me.Button4.TabIndex = 3
Me.Button4.Text = "Button4"
'
'Form1
'
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.flowRightToLeftBtn)
Me.Controls.Add(Me.flowLeftToRight)
Me.Controls.Add(Me.flowBottomUpBtn)
Me.Controls.Add(Me.flowTopDownBtn)
Me.Controls.Add(Me.wrapContentsCheckBox)
Me.Controls.Add(Me.FlowLayoutPanel1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.FlowLayoutPanel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend Shared ReadOnly Property GetInstance() As Form1
Get
If m_DefaultInstance Is Nothing OrElse m_DefaultInstance.IsDisposed() Then
SyncLock m_SyncObject
If m_DefaultInstance Is Nothing OrElse m_DefaultInstance.IsDisposed() Then
m_DefaultInstance = New Form1
End If
End SyncLock
End If
Return m_DefaultInstance
End Get
End Property
Private Shared m_DefaultInstance As Form1
Private Shared m_SyncObject As New Object
#End Region
End Class
注解
FlowLayoutPanel 控件沿水平或纵排方向排列其内容。 可从一行到下一行,或从一列到下列进行内容换行。 或者,可以剪切而不是包装其内容。
可以通过设置 FlowDirection 属性的值来指定排列方向。 控件 FlowLayoutPanel 在从右到左 (RTL) 布局中正确反转其流动方向。 还可以通过设置 属性的值WrapContents来指定是包装还是剪裁控件的内容FlowLayoutPanel。
任何Windows 窗体控件(包括 的其他实例)FlowLayoutPanel都可以是 控件FlowLayoutPanel的子级。 使用此功能,可以构造在运行时适应窗体尺寸的复杂布局。
子控件的停靠和锚定行为不同于其他容器控件中的行为。 停靠和锚定均相对于流方向上的最大控件。 有关详细信息,请参阅 如何:在 FlowLayoutPanel 控件中定位和停靠子控件。
构造函数
FlowLayoutPanel() |
初始化 FlowLayoutPanel 类的新实例。 |
字段
ScrollStateAutoScrolling |
确定 AutoScroll 属性的值。 (继承自 ScrollableControl) |
ScrollStateFullDrag |
确定用户是否启用了全窗口拖动。 (继承自 ScrollableControl) |
ScrollStateHScrollVisible |
确定 HScroll 属性的值是否设置为 |
ScrollStateUserHasScrolled |
确定用户是否滚动了 ScrollableControl 控件。 (继承自 ScrollableControl) |
ScrollStateVScrollVisible |
确定 VScroll 属性的值是否设置为 |
属性
AccessibilityObject |
获取分配给该控件的 AccessibleObject。 (继承自 Control) |
AccessibleDefaultActionDescription |
获取或设置控件的默认操作说明以供具有辅助功能的客户端应用程序使用。 (继承自 Control) |
AccessibleDescription |
获取或设置辅助功能客户端应用程序使用的控件说明。 (继承自 Control) |
AccessibleName |
获取或设置辅助功能客户端应用程序所使用的控件名称。 (继承自 Control) |
AccessibleRole |
获取或设置控件的辅助性角色。 (继承自 Control) |
AllowDrop |
获取或设置一个值,该值指示控件是否可以接受用户拖放到它上面的数据。 (继承自 Control) |
Anchor |
获取或设置控件绑定到的容器的边缘并确定控件如何随其父级一起调整大小。 (继承自 Control) |
AutoScroll |
获取或设置一个值,该值指示容器是否允许用户滚动到任何放置在其可见边界之外的控件。 (继承自 ScrollableControl) |
AutoScrollMargin |
获取或设置自动滚动边距的大小。 (继承自 ScrollableControl) |
AutoScrollMinSize |
获取或设置自动滚动的最小尺寸。 (继承自 ScrollableControl) |
AutoScrollOffset |
获取或设置一个值,该值指示在 ScrollControlIntoView(Control) 中将控件滚动到何处。 (继承自 Control) |
AutoScrollPosition |
获取或设置自动滚动定位的位置。 (继承自 ScrollableControl) |
AutoSize |
获取或设置一个值,该值指示控件是否基于其内容调整大小。 (继承自 Panel) |
AutoSizeMode |
指示控件的自动调整大小行为。 (继承自 Panel) |
BackColor |
获取或设置控件的背景色。 (继承自 Control) |
BackgroundImage |
获取或设置在控件中显示的背景图像。 (继承自 Control) |
BackgroundImageLayout |
获取或设置在 ImageLayout 枚举中定义的背景图像布局。 (继承自 Control) |
BindingContext |
获取或设置控件的 BindingContext。 (继承自 Control) |
BorderStyle |
指示控件的边框样式。 (继承自 Panel) |
Bottom |
获取控件下边缘与其容器的工作区上边缘之间的距离(以像素为单位)。 (继承自 Control) |
Bounds |
获取或设置控件(包括其非工作区元素)相对于其父控件的大小和位置(以像素为单位)。 (继承自 Control) |
CanEnableIme |
获取一个用以指示是否可以将 ImeMode 属性设置为活动值的值,以启用 IME 支持。 (继承自 Control) |
CanFocus |
获取一个值,该值指示控件是否可以接收焦点。 (继承自 Control) |
CanRaiseEvents |
确定是否可以在控件上引发事件。 (继承自 Control) |
CanSelect |
获取一个值,该值指示是否可以选中控件。 (继承自 Control) |
Capture |
获取或设置一个值,该值指示控件是否已捕获鼠标。 (继承自 Control) |
CausesValidation |
获取或设置一个值,该值指示控件是否会引起在任何需要在接收焦点时执行验证的控件上执行验证。 (继承自 Control) |
ClientRectangle |
获取表示控件的工作区的矩形。 (继承自 Control) |
ClientSize |
获取或设置控件的工作区的高度和宽度。 (继承自 Control) |
CompanyName |
获取包含控件的应用程序的公司名称或创建者。 (继承自 Control) |
Container |
获取包含 IContainer 的 Component。 (继承自 Component) |
ContainsFocus |
获取一个值,该值指示控件或它的一个子控件当前是否有输入焦点。 (继承自 Control) |
ContextMenu |
获取或设置与控件关联的快捷菜单。 (继承自 Control) |
ContextMenuStrip |
获取或设置与此控件关联的 ContextMenuStrip。 (继承自 Control) |
Controls |
获取包含在控件内的控件的集合。 (继承自 Control) |
Created |
获取一个值,该值指示控件是否已经创建。 (继承自 Control) |
CreateParams |
获取创建控件句柄时所需要的创建参数。 (继承自 Panel) |
Cursor |
获取或设置当鼠标指针位于控件上时显示的光标。 (继承自 Control) |
DataBindings |
为该控件获取数据绑定。 (继承自 Control) |
DataContext |
获取或设置用于数据绑定的数据上下文。 这是一个环境属性。 (继承自 Control) |
DefaultCursor |
获取或设置控件的默认光标。 (继承自 Control) |
DefaultImeMode |
获取控件支持的默认输入法编辑器 (IME) 模式。 (继承自 Control) |
DefaultMargin |
获取控件之间默认指定的间距(以像素为单位)。 (继承自 Control) |
DefaultMaximumSize |
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最大大小。 (继承自 Control) |
DefaultMinimumSize |
获取以像素为单位的长度和高度,此长度和高度被指定为控件的默认最小大小。 (继承自 Control) |
DefaultPadding |
获取 控件内容的默认内部间距(以像素为单位)。 (继承自 Control) |
DefaultSize |
获取控件的默认大小。 (继承自 Panel) |
DesignMode |
获取一个值,用以指示 Component 当前是否处于设计模式。 (继承自 Component) |
DeviceDpi |
获取显示当前控件的显示设备的 DPI 值。 (继承自 Control) |
DisplayRectangle |
获取表示控件的虚拟显示区域的矩形。 (继承自 ScrollableControl) |
Disposing |
获取一个值,该值指示 Control 基类是否在释放进程中。 (继承自 Control) |
Dock |
获取或设置哪些控件边框停靠到其父控件并确定控件如何随其父级一起调整大小。 (继承自 Control) |
DockPadding |
获取控件的所有边缘的停靠边距设置。 (继承自 ScrollableControl) |
DoubleBuffered |
获取或设置一个值,该值指示此控件是否应使用辅助缓冲区重绘其图面,以减少或避免闪烁。 (继承自 Control) |
Enabled |
获取或设置一个值,该值指示控件是否可以对用户交互作出响应。 (继承自 Control) |
Events |
获取附加到此 Component 的事件处理程序的列表。 (继承自 Component) |
FlowDirection |
获取或设置一个值,该值指示 FlowLayoutPanel 控件的流向。 |
Focused |
获取一个值,该值指示控件是否有输入焦点。 (继承自 Control) |
Font |
获取或设置控件显示的文字的字体。 (继承自 Control) |
FontHeight |
获取或设置控件的字体的高度。 (继承自 Control) |
ForeColor |
获取或设置控件的前景色。 (继承自 Control) |
Handle |
获取控件绑定到的窗口句柄。 (继承自 Control) |
HasChildren |
获取一个值,该值指示控件是否包含一个或多个子控件。 (继承自 Control) |
Height |
获取或设置控件的高度。 (继承自 Control) |
HorizontalScroll |
获取与水平滚动条关联的特征。 (继承自 ScrollableControl) |
HScroll |
获取或设置一个值,该值指示水平滚动条是否可见。 (继承自 ScrollableControl) |
ImeMode |
获取或设置控件的输入法编辑器 (IME) 模式。 (继承自 Control) |
ImeModeBase |
获取或设置控件的 IME 模式。 (继承自 Control) |
InvokeRequired |
获取一个值,该值指示调用方在对控件进行方法调用时是否必须调用 Invoke 方法,因为调用方位于创建控件所在的线程以外的线程中。 (继承自 Control) |
IsAccessible |
获取或设置一个值,该值指示控件对辅助功能应用程序是否可见。 (继承自 Control) |
IsAncestorSiteInDesignMode |
指示此控件的上级之一是否位于 DesignMode 中。 此属性为只读。 (继承自 Control) |
IsDisposed |
获取一个值,该值指示控件是否已经被释放。 (继承自 Control) |
IsHandleCreated |
获取一个值,该值指示控件是否有与它关联的句柄。 (继承自 Control) |
IsMirrored |
获取一个值,该值指示此控件是否为镜像控件。 (继承自 Control) |
LayoutEngine |
获取面板的布局引擎的缓存实例。 |
Left |
获取或设置控件左边缘与其容器的工作区左边缘之间的距离(以像素为单位)。 (继承自 Control) |
Location |
获取或设置该控件的左上角相对于其容器的左上角的坐标。 (继承自 Control) |
Margin |
获取或设置控件之间的空间。 (继承自 Control) |
MaximumSize |
获取或设置大小,该大小是 GetPreferredSize(Size) 可以指定的上限。 (继承自 Control) |
MinimumSize |
获取或设置大小,该大小是 GetPreferredSize(Size) 可以指定的下限。 (继承自 Control) |
Name |
获取或设置控件的名称。 (继承自 Control) |
Padding |
获取或设置控件内的空白。 (继承自 Control) |
Parent |
获取或设置控件的父容器。 (继承自 Control) |
PreferredSize |
获取可以容纳控件的矩形区域的大小。 (继承自 Control) |
ProductName |
获取包含控件的程序集的产品名称。 (继承自 Control) |
ProductVersion |
获取包含控件的程序集的版本。 (继承自 Control) |
RecreatingHandle |
获取一个值,该值指示控件当前是否在重新创建其句柄。 (继承自 Control) |
Region |
获取或设置与控件关联的窗口区域。 (继承自 Control) |
RenderRightToLeft |
已过时.
已过时.
此属性现已过时。 (继承自 Control) |
ResizeRedraw |
获取或设置一个值,该值指示控件在调整大小时是否重绘自己。 (继承自 Control) |
Right |
获取控件右边缘与其容器的工作区左边缘之间的距离(以像素为单位)。 (继承自 Control) |
RightToLeft |
获取或设置一个值,该值指示是否将控件的元素对齐以支持使用从右向左的字体的区域设置。 (继承自 Control) |
ScaleChildren |
获取一个值,该值确定子控件的缩放。 (继承自 Control) |
ShowFocusCues |
获取一个值,该值指示控件是否应显示聚焦框。 (继承自 Control) |
ShowKeyboardCues |
获取一个值,该值指示用户界面是否处于适当的状态以显示或隐藏键盘快捷键。 (继承自 Control) |
Site |
获取或设置控件的站点。 (继承自 Control) |
Size |
获取或设置控件的高度和宽度。 (继承自 Control) |
TabIndex |
获取或设置控件在其容器内的 Tab 键顺序。 (继承自 Control) |
TabStop |
获取或设置一个值,该值指示用户能否使用 Tab 键将焦点放到该控件上。 (继承自 Panel) |
Tag |
获取或设置包含有关控件的数据的对象。 (继承自 Control) |
Text |
此成员对于此控件无意义。 (继承自 Panel) |
Top |
获取或设置控件上边缘与其容器的工作区上边缘之间的距离(以像素为单位)。 (继承自 Control) |
TopLevelControl |
获取没有另一个 Windows 窗体控件作为其父级的父控件。 通常,这是控件所在的最外面的 Form。 (继承自 Control) |
UseWaitCursor |
获取或设置一个值,该值指示是否将等待光标用于当前控件以及所有子控件。 (继承自 Control) |
VerticalScroll |
获取与垂直滚动条相关联的特性。 (继承自 ScrollableControl) |
Visible |
获取或设置一个值,该值指示是否显示该控件及其所有子控件。 (继承自 Control) |
VScroll |
获取或设置一个值,该值指示垂直滚动条是否可见。 (继承自 ScrollableControl) |
Width |
获取或设置控件的宽度。 (继承自 Control) |
WindowTarget |
此属性与此类无关。 (继承自 Control) |
WrapContents |
获取或设置一个值,该值指示应当对 FlowLayoutPanel 控件的内容进行换行还是剪裁。 |
方法
事件
显式接口实现
IDropTarget.OnDragDrop(DragEventArgs) |
引发 DragDrop 事件。 (继承自 Control) |
IDropTarget.OnDragEnter(DragEventArgs) |
引发 DragEnter 事件。 (继承自 Control) |
IDropTarget.OnDragLeave(EventArgs) |
引发 DragLeave 事件。 (继承自 Control) |
IDropTarget.OnDragOver(DragEventArgs) |
引发 DragOver 事件。 (继承自 Control) |
IExtenderProvider.CanExtend(Object) |
有关此成员的说明,请参见 CanExtend(Object)。 |