This may seem a trite question but I find the Microsoft documentation on these methods lacking in any detail.
What is the difference between TablelLayoutPanel.GetCellPosition(Control control)
and TableLayoutPanel.GetPositionFromControl(Control control)
?
I'm using .NET Framework 4
GetCellPosition
gets the declared position of the control, where asGetPositionFromControl
gets the actual position theTableLayoutPanel
has decided for the control. These are the same in most cases. Programatically set several controls to the same cell (or overlapping cells withColumnSpan
orRowSpan
,) and see how the results differ.Add a TableLayoutPanel to a Form and copy the following code. Run it and click on a Label to see the difference.