Can i add particular color for entire Row or Column in TableLayoutPanel ? How ? please provide sample code if any ..
Thanks in adv.
I found this answer much easier to implement:
This allowed me to put a full backcolor on my cell.
Panel
, which has a backcolor, and Dock
that Panel
in my TableLayoutPanel
Then that TableLayoutPanel
Cell has a
backcolor.
My Code ended up looking like this:
Panel backgroundColorPanel = new Panel();
backgroundColorPanel.BackColor = Color.FromArgb(243, 243, 243);
backgroundColorPanel.Dock = DockStyle.Fill;
backgroundColorPanel.Margin = new Padding(0);
backgroundColorPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left));
backgroundColorPanel.AutoSize = true;
backgroundColorPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.originalTableLayoutPanel.Controls.Add(backgroundColorPanel, 0, row);
http://www.codeguru.com/forum/showthread.php?t=444944