问题1:
我想从Properties.Resource.image直接在TableLayoutPanel的单元格中添加图像。
lock
问题2: 我想更改单元格背景颜色的简单样式...
tableLayoutPanel1.Controls.Add(Properties.Resource.image,column,row);
//cell backround should be covered with image
不是那个话题。我什至不能这样做。 How to set cell color in TableLayoutPanel dynamically?
答案 0 :(得分:0)
您可以在TableLayoutPanel中托管一个PictureBox来显示图像或重置其背景颜色。
private void Form1_Load(object sender, EventArgs e)
{
PictureBox pictureBox = new PictureBox();
this.tableLayoutPanel1.Controls.Add(pictureBox, 1,1);
// Set background image
pictureBox.Image = Properties.Resources.TestImage;
// Set background color
//pictureBox.BackColor = Color.Red;
}