Hello everybody,![]()
I am trying to dynamically add a button to a TableLayoutPanel at a particular column and row location, but I don't seem to be having much luck so far.
The following code compiles, but I don't see anything on my form (Form1). Any help would be much appreciated in solving the problem.
What I would like to eventually have working is a routine that would use two arrays of integer values for the cell positions - (in conjunction with an array of Button objects) to determine where in the TableLayoutPanel my Button objects would be added.
Code://This is just a test to get the basics working first!!! public Form1() { InitializeComponent(); Button MyButton = new Button(); MyButton.Visible = true; TableLayoutPanel MyPanel = new TableLayoutPanel(); TableLayoutPanelCellPosition MyCellPosition = new TableLayoutPanelCellPosition(); MyCellPosition.Column = 1; MyCellPosition.Row = 1; MyPanel.SetCellPosition(MyButton, MyCellPosition); }




Reply With Quote