Reputation: 1185
Controls in TableLayoutPanel
get additional properties that are accessible in IDE. One is Row
and another is Column
, relative to TableLayoutPanel
.
How do I get those properties' values by code?
I need to loop through all controls in my TableLayoutPanel
and issue instructions based on their relative positions; but when I cast retrieved controls as a specific type, I don't get Row
and Column
properties.
Upvotes: 0
Views: 2356
Reputation:
You need to do it the other way around. Use TableLayoutPanel.GetCellPosition(Control c)
method and pass your control to the method. Assign the return value to TableLayoutPanelCellPosition
class variable. That object has Row
and Column
properties that return integer values.
Upvotes: 2