TableLayoutPanel Control Column Properties


I noticed that each control added to the TableLayoutPanel is provided with the "Column" and "Row" properties. How can I access these properties using code?
thank:)

+3
source share
4 answers

These properties exist only in the properties window, which is provided by the IExtenderProvider interface. They do not exist at run time. Extended properties:

  • ColumnSpan. Runtime: GetColumnSpan () and SetColumnSpan ()
  • RowSpan. Runtime: GetRowSpan () and SetRowSpan ()
  • Line. Runtime: GetRow () and SetRow ()
  • Cell. Runtime: GetCellPosition () and SetCellPosition ()
  • Column. Runtime: GetColumn () and SetColumn ()

, TLP . .

+5

Go .

" ", , ToolTip.

+3

, (SetColumn (, ) SetRow (, )).

.

+3

// LayoutPanel TableLayoutPanel tlp = new TableLayoutPanel();

// Set BorderStyle to insert tlp.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset;

// Grid has two columns
tlp.ColumnCount = 2;

// Grid has two rows
tlp.RowCount = 2;

// If grid is full add extra cells by adding column
tlp.GrowStyle = TableLayoutPanelGrowStyle.AddColumns;

// Padding (pixels)within each cell (left, top, right, bottom)
tlp.Padding = new Padding(1, 1, 4, 5);

// Add TableLayoutPanel to the Forms controls
this.Controls.Add(tlp);

for more details

http://en.csharp-online.net/TableLayoutPanel

0
source

Source: https://habr.com/ru/post/1791026/


All Articles