Click here to Skip to main content
13,254,077 members (61,233 online)
Click here to Skip to main content
Add your own
alternative version


18 bookmarked
Posted 22 Nov 2004

FlowLayoutPanel & TableLayoutPanel controls (Visual Studio 2005)

, 22 Nov 2004
Rate this:
Please Sign up or sign in to vote.
Visual Studio 2005 introduces the concept of Layout designing. Two new controls have been added to support this, the FlowLayoutPanel and TableLayoutPanel. This article describes these two new cool features of the new version of the Visual Studio .Net 2005.


There are two interesting components which I noticed in the Windows Forms Toolbox (Visual Studio 2005), which I would like to point out here.

  1. FlowLayoutPanel
  2. TableLayoutPanel

This is apart from the regular 'Panel' control that is included with the previous versions also.

Screenshot of the Layout controls in toolbox


Both of these controls give tremendous control and ease in placing the controls properly and in an orderly fashion on the form.


In the FlowLayoutPanel, whatever controls that you place in the panel, will rearrange itself to right of the previous control, in a flowing model. If the right side of the previous control does not have enough space, it would wrap itself to the next available space at the bottom.

I found this to be very useful while placing many triplets of label->textbox->button controls one below the other and close to each other.

See a screehshot to get a feel of it in action.

 Screenshot of FlowLayoutPanel in action

You can also decide on the direction in which the controls will flow. For this you have to set the property 'FlowDirection'.

It takes 4 enum values viz.

1. LeftToRight
2. TopDown
3. RightToLeft
4. BottomUp

The automatic wrapping functionality as I explained earlier also can be set by a property called 'WrapContents'. This is boolean field. Default is set to true.


In TableLayoutPanel, the arrangement is in a tabular format as the name itself suggests. When you add a control to a cell of the table, it would reposition itself to the center of the cell.  One cell of the table will take only one control. You can add as many rows/columns to the layout.

This is extremely useful while placing multitudes of controls on a form in a correct and orderly fashion. This avoids the main headache while designing a form when it comes to inserting some controls in between the existing controls and you have to sit and re-align all the remaining controls that got affected.

Screenshot of TableLayoutPanel in action


You can manually set the columns and rows the panel should hold by setting the 'ColumnCount' and 'RowCount' properties respectively.

The context menu also supports adding and removing columns and rows.

Context menu for the TableLayoutPanel  



The Layout feature in the latest Visual Studio 2005 is an excellent addition which gives very good control on how the controls are placed on the form and Microsoft has done a tremendous job in bringing it to the design time.



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
He is working with Wipro Technologies, Bangalore and have been concentrating on Microsoft technologies including VC++ for the past 4 years. Currently he is into the .Net technologies like C#, VB.Net and ASP.Net. In addition, he has also a MCAD.Net certification under his belt.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 2 Pin
Member 350637219-Sep-12 2:43
memberMember 350637219-Sep-12 2:43 
GeneralMy vote of 3 Pin
itsho18-Oct-11 23:26
memberitsho18-Oct-11 23:26 
GeneralMy vote of 5 Pin
Estherino15-Jun-11 22:14
memberEstherino15-Jun-11 22:14 
GeneralMy vote of 2 Pin
ashishkum15-Feb-11 23:22
memberashishkum15-Feb-11 23:22 
GeneralMy vote of 1 Pin
DungVinh12-Dec-09 14:58
memberDungVinh12-Dec-09 14:58 
GeneralMy vote of 1 Pin
cagret11-Sep-09 9:07
membercagret11-Sep-09 9:07 
GeneralMy vote of 1 Pin
FlaviusJS25-Jun-09 3:37
memberFlaviusJS25-Jun-09 3:37 
GeneralMy vote of 1 Pin
sfalconi772-Dec-08 0:03
membersfalconi772-Dec-08 0:03 
QuestionDynamic Field nameing? Pin
Yeti199316-Oct-07 13:46
memberYeti199316-Oct-07 13:46 
QuestionHow to Manual Added Controls to FlowLayoutPanel? Pin
AYR Chen3-Jul-07 14:10
memberAYR Chen3-Jul-07 14:10 
QuestionPreformance issue with TableLayoutPanel Pin
reilit29-Mar-07 1:16
memberreilit29-Mar-07 1:16 
AnswerRe: Preformance issue with TableLayoutPanel Pin
Bas Steijvers2-Sep-08 3:33
memberBas Steijvers2-Sep-08 3:33 
QuestionHow To Get "Row Selected" Pin
Alexis Blaze20-Feb-07 4:59
memberAlexis Blaze20-Feb-07 4:59 
GeneralCentering controls Pin
David LattimoreGay30-Oct-06 3:15
memberDavid LattimoreGay30-Oct-06 3:15 
GeneralRe: Centering controls Pin
David LattimoreGay30-Oct-06 3:20
memberDavid LattimoreGay30-Oct-06 3:20 
QuestionPLEASE HELP!!!! Pin
danielab21-Aug-06 10:36
memberdanielab21-Aug-06 10:36 
QuestionAnything for 1.1? Pin
Kevin.Jensen23-Nov-04 4:27
sussKevin.Jensen23-Nov-04 4:27 
AnswerRe: Anything for 1.1? Pin
dmkp17-May-17 5:21
memberdmkp17-May-17 5:21 
GeneralI was hoping... Pin
Marc Clifton23-Nov-04 2:14
protectorMarc Clifton23-Nov-04 2:14 
Questionjava Builders !? Pin
Ivan Mladenovic23-Nov-04 1:24
sussIvan Mladenovic23-Nov-04 1:24 
AnswerRe: java Builders !? Pin
Larkin20-Dec-05 13:58
memberLarkin20-Dec-05 13:58 
QuestionAnd ? Pin
Maximilien22-Nov-04 4:12
memberMaximilien22-Nov-04 4:12 
AnswerRe: And ? Pin
programmer_vb.net_c++9-Feb-09 10:04
memberprogrammer_vb.net_c++9-Feb-09 10:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 22 Nov 2004
Article Copyright 2004 by zubinraj
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid