- Back to Home »
- Windows Applications »
- FlowLayoutPanel
Posted by :
Sudhir Chekuri
Wednesday, 17 February 2016
It is capable of holding multiple controls inside it and it will arrange them in automatically an order.
Properties:
FlowDirection: Specifies the direction in which controls are laid out.
Example: LeftToRight, RightToLeft, TopDown, BottomUp
WrapContents: Set to wrap controls inside it or false to make controls go outside the border of the panel.
Steps to use FlowLayoutPanel
Drag and drop a FlowLayoutPanel.
Then drag and drop controls into FlowLayoutPanel and you can see that they are automatically arrange in an order.
Default Event: Paint which is fired when it is created
Code to change the FlowDirection when it is created
Properties:
FlowDirection: Specifies the direction in which controls are laid out.
Example: LeftToRight, RightToLeft, TopDown, BottomUp
WrapContents: Set to wrap controls inside it or false to make controls go outside the border of the panel.
Steps to use FlowLayoutPanel
Drag and drop a FlowLayoutPanel.
Then drag and drop controls into FlowLayoutPanel and you can see that they are automatically arrange in an order.
Default Event: Paint which is fired when it is created
Code to change the FlowDirection when it is created
private void
flowLayoutPanel1_Paint(object sender, PaintEventArgs e)
{
flowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft;
}