Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm using TableLayoutPanel as table. Each Table cells has panel controls. Some Panel controls has Label control in it.

When I want to use PANEL controls, I can use

VB
Dim ipanel as panel = TryCast(TableLayoutPanel.Getcontrolfromposition(i,j),panel)
ipanel.backcolor = color.gray ' for example

I can use all CHILD PANEL properties like this in for-next statements. But also, some of child PANEL Controls in the TableLayoutPanel, has other Label controls in it.

How can I use the LABEL controls properties here as?

I have to use for next to scan for all cells of TableLayoutPanel. therefore, I need to reach as
ilable = ipanel.controls (I know writing here is not correct, just to explain What I needed)

Thanks in advance
Posted
Updated 10-Jun-13 16:27pm
v3

1 solution

Ok. I found solution :)

VB
Dim c As Control = Me.TableLayoutPanel1.GetControlFromPosition(i, j)
If c.HasChildren() Then
    Dim pt As Point
    Dim L As Control = c.GetChildAtPoint(pt)
    L.Text = c.Tag
End If
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900