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.
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
How can i get 3 items on each line in a FlowLayoutPanel so the new will go to next line ? loove;
hello
you can set the flowdirection of the flowlayout panel
to lefttoright
you can test this with:
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
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
Dummy1912 wrote:helloThis 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
you can set the flowdirection of the flowlayout panel
to lefttoright
you can test this with:
Code: Select allFor i = 1 To 3 Step 1 Dim test As New label test.text = i FlowLayoutPanel1.Controls.Add(test) Next
* * *
* * *
* * *
with your method id does like this * * * * * *
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
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
Dummy1912 wrote:well then you have to set topdownThat will just add all items down
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
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
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
Dummy1912 wrote:i think its better if you usedThe problem is im trying to add images that is loaded from websites so it will show thumbnails
tablelayoutpanel
you can make own columns and rows
then you just have to drag the label in to it
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
mandai wrote:It is possible to do this with the FlowLayoutPanel. You would need to use the SetFlowBreak function:I could not get this to work, also im trying to do it with a usercontrol that has a picturebox in itCode: Select allPrivate 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
Edit: i resolved this i just had to sest WrapContent to true idoit; stupid me
9 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023