FlowLayoutPanel

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
9 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

FlowLayoutPanel
AnoPem
How can i get 3 items on each line in a FlowLayoutPanel so the new will go to next line ? loove;
https://t.me/pump_upp
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: FlowLayoutPanel
Dummy1912
hello

you can set the flowdirection of the flowlayout panel
to lefttoright

you can test this with:
Code: Select all
For i = 1 To 3 Step 1
            Dim test As New label
            test.text = i
            FlowLayoutPanel1.Controls.Add(test)
        Next
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: FlowLayoutPanel
AnoPem
Dummy1912 wrote:
hello

you can set the flowdirection of the flowlayout panel
to lefttoright

you can test this with:
Code: Select all
For i = 1 To 3 Step 1
            Dim test As New label
            test.text = i
            FlowLayoutPanel1.Controls.Add(test)
        Next
This is not excatly what i need i would like to that every 3 items it goes to the next line of items and add 3 mores so

* * *
* * *
* * *

with your method id does like this * * * * * *
https://t.me/pump_upp
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: FlowLayoutPanel
Dummy1912
well then you have to set topdown
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: FlowLayoutPanel
AnoPem
Dummy1912 wrote:
well then you have to set topdown
That will just add all items down
https://t.me/pump_upp
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Re: FlowLayoutPanel
Dummy1912
i think its better if you used

tablelayoutpanel
you can make own columns and rows
then you just have to drag the label in to it :)
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: FlowLayoutPanel
AnoPem
Dummy1912 wrote:
i think its better if you used

tablelayoutpanel
you can make own columns and rows
then you just have to drag the label in to it :)
The problem is im trying to add images that is loaded from websites so it will show thumbnails
https://t.me/pump_upp
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: FlowLayoutPanel
mandai
It is possible to do this with the FlowLayoutPanel. You would need to use the SetFlowBreak function:
Code: Select all
    Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click

        For i As Integer = 1 To 4 - 1
            Dim test As New Label()
            test.Text = i
            FlowLayoutPanel1.Controls.Add(test)

            If i = 3 Then
                FlowLayoutPanel1.SetFlowBreak(test, True)
            End If
        Next

    End Sub
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: FlowLayoutPanel
AnoPem
mandai wrote:
It is possible to do this with the FlowLayoutPanel. You would need to use the SetFlowBreak function:
Code: Select all
    Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click

        For i As Integer = 1 To 4 - 1
            Dim test As New Label()
            test.Text = i
            FlowLayoutPanel1.Controls.Add(test)

            If i = 3 Then
                FlowLayoutPanel1.SetFlowBreak(test, True)
            End If
        Next

    End Sub
I could not get this to work, also im trying to do it with a usercontrol that has a picturebox in it

Edit: i resolved this i just had to sest WrapContent to true idoit; stupid me
https://t.me/pump_upp
9 posts Page 1 of 1
Return to “Coding Help & Support”