Hallo Leute!
Bin neu hier, habt bitte Mitleid, wenn ich Fragen falsch stelle.
Ich habe ein TableLayoutPanel in das zur Laufzeit UserControls erstellt werden.
Nun würde ich gerne die CellPositions jedes erstellten Controls ermitteln. Mit einzelnen funktioniert das schon ganz gut.
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
| //Aktives Control ermitteln private void tblLayoutMain_Enter(object sender, EventArgs e) { Point p = tblLayoutMain.PointToClient(Control.MousePosition); _activeControl = tblLayoutMain.GetChildAtPoint(p); }
private void btnTake_Click(object sender, EventArgs e) { TableLayoutPanelCellPosition position1 = new TableLayoutPanelCellPosition(); position1 = tblLayoutMain.GetCellPosition(_activeControl); string test = position1.ToString(); MessageBox.Show(test); } |
Doch wie bekomme ich alle Positionen, also auch die von den "inaktiven"?
Vielen Dank im Voraus