Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Direct access to TableLayoutPanel Cells

Tags:

c#

winforms

I have a TableLayoutPanel where each cell contains a single panel. I would like to be able to directly access any one of the cells by row and column and do something to the panel in it. I cannot for the life of me figure out if I can access controls within a cell. It would be great if I could do something like:

Panel p = layoutPanel.Cell(x,y).Controls[0] as Panel;

p.dosomethingCool();

But I cannot seem to get that kind of access, even though it seems like something that should be quite possible.

like image 761
captncraig Avatar asked Oct 21 '09 03:10

captncraig


1 Answers

I found it, it is layoutPanel.GetControlFromPosition(x,y);

like image 52
captncraig Avatar answered Oct 24 '22 02:10

captncraig