views:

57

answers:

2

Whenever I am adding New TableLayoutPanel programmatically in a Panel by setting DockStyle.Top, the last added TableLayoutPanel goes at the top most position of the Panel and the TableLayoutPanel added first comes down.

Example: If I add like 1 2 3 4 5

It adds as 5 4 3 2 1

Please help me to fix the problem. The TableLayoutPanels should maintain the order as I am adding.

Thanx.

A: 

Can you check by setting Send to back after adding the control?

Ram
A: 

You must specify the rows and colums for the TableLayoutPanel. Moreover, you must add a control to the correct cell. One control per cell (which may span multiple cells). You may be able to add more that one control, but the results will be unexpected and unreliable. In addition, you may experience layout issues (which you are experiencing now). If you want to add five controls, for example, to one cell, then add a FlowLayoutPanel to a cell (which may span multiple cells), then add the five controls to this flow-layout-panel.

AMissico