-1
作爲這個問題的後續內容 - Direct access to TableLayoutPanel Cells,如何枚舉TableLayoutPanel中單元格內的控件?從下面的圖片中,我想枚舉給定單元格中的所有複選框(以便我可以更改它們的值)。枚舉TableLayoutPanel單元格位置內的控件
我已經寫了這個代碼,試圖解釋什麼,我試圖做(這是一個複選框);
var tableLayoutPanel = (TableLayoutPanel)this.Parent;
var cellPosition = tableLayoutPanel.GetCellPosition(this);
var controlAtPosition = tableLayoutPanel.GetControlFromPosition(cellPosition.Column,cellPosition.Row).Controls;
foreach (Control control in controlAtPosition)
{
var ctrl = control.Name;
// *** Enumerates nothing
}