Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 29939 |  Welcome, Guest!   Register  Login
Home > Articles > Windows Forms > Working with the FlowLayout Panel

Working with the FlowLayout Panel

Article posted by Initiotech on 9/21/2009 | Views: 13097 | Category: Windows Forms | Level: Intermediate red flag


This Article will explain how to work with the FlowLayoutPanel control which is new in the DotNet Framework 2.0

Download


 Download source code for Working with the FlowLayout Panel


The FlowLayoutPanel is a derived from the Panel control.
Like the
Panel control, it is most commonly used to create container for group of similar controls. The FlowLayoutPanel dynamically repositions the controls it contains

when it is resized at either design time or run time unlike the Panel Control.

Because of which the control positions are automatically adjusted as the size and dimensions of the FlowLayoutPanel.

The FlowLayoutPanel is very similar to the FlowLayout panel as in Java.

The FlowLayoutPanel also supports Scroll.It is only enabled when the AutoScroll property is set to True.
It will keep on placing new controls one after the other in the Right-Left Order.

After the Controls reaches the end of the Current Row It will automatically break the flow and add the control in the next row below it in case where the FlowDirection is set to Left to Right or Right to Left.

 

If the WrapContents  property is set to False It will stop wraping the contents and go on adding the Controls on the same row or column.

 

You can manually create Flow Breaks using the SetFlowBreak method of the FlowLayoutPanel Example . 
Private
Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Adding 10 TextBoxes to the FlowLayout Panel
        For index As Integer = 0 To 11
            Dim txt As New TextBox()
            txt.Name = "Txt " & (index + 1)
            txt.Text = txt.Name

            If index Mod 2 Then
             FlowLayoutPanel1.SetFlowBreak(txt, True) 'Setting the FlowBreak at every Even index
            End If
            FlowLayoutPanel1.Controls.Add(txt)
        Next
End Sub

Regards
Hefin Dsouza

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

About Hefin Dsouza

Experience:8 year(s)
Home page:http://hefin.in
Member since:Wednesday, September 16, 2009
Level:Starter
Status: [Member]
Biography:My Name is Hefin Dsouza.
I am a faculty at Computer Education Institute.I am also an Freelance Software Developer and Software Trainner.I am working with DotNet Technologies from the past 8 years.I am an Microsoft Certified Windows Application Developer for .NET 3.5.
And also a Blogger at http://blog.hefin.in
>> Write Response - Respond to this post and get points
Related Posts

In this Article i am going to explain you how to Export a DataGridView(Windows) data to a TextFile(.txt)

Clear 10 or more textboxes in just one click.

In this article explains you how to create Stopwatch Application using C#.

Abstract: In this article, I am going to explain setup and deployment procedure in windows project by using visual studio. To demonstrate this article I took small Merlin.acs [.acs=Agent character structured storage file] COM Component and teddy Bear Database Manips in my Windows Project. Finally I will give total roundtrip for Setting up and deployment of windows Project. I divided this article into two Parts. In this part, I explained total development procedure in windows and C# by utilizing COM Components and Database Manipulations Using ms access.

In Windows application development, we have few built-in extender components like ErrorProvider, Tooltip, etc. Extender component will add few more properties to built-in controls to enhance the functionality. In this article we will discuss about creating a custom extender component for Windows controls.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/28/2012 11:58:52 AM