|
-
Sep 30th, 2022, 12:07 PM
#1
Thread Starter
Hyperactive Member
How to get a Control cell row and column in TableLayoutPanel?
Hi, I suppose the thread name is totally obvious but here's the better question:
Consider a changeable row and column TableLayoutPanel matrix-shaped table. Filled with a UserControl. A label in these UserControls (Which are not fix in quantity) should get cell row and column like an address. for a 3x4 tables we would like to have this result:
0,0 0,1 0,2
1,0 1,1 1,2
2,0 2,1 2,2
3,0 3,1 3,2
Controls are automatically added as below:
Code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For i = 0 To RowCount.Value - 1
For j = 0 To ColumnCount.Value - 1
TableLayoutPanel1.Controls.Add(New UserControl1, j, i)
Next
Next
End Sub
* I'm struggling a lot with this Table Layout Panel control in spite of being a very useful component both for reducing coding and improving visual friendly, it is a very tricky control.
I have a couple more questions. Can I ask them in following replies or moderators recommend me to dedicate threads for them individually? Will I be banned as spammer for it?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|