【发布时间】:2009-12-02 16:59:10
【问题描述】:
私有 TableLayoutPanel CreateLayoutpan() { pTablePanel = new TableLayoutPanel(); pTablePanel.BackColor = System.Drawing.SystemColors.ButtonFace; pTablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute,30)); pTablePanel.RowStyles.Add(new RowStyle()); pTablePanel.Size = new System.Drawing.Size(165, 223); pTablePanel.Location = new System.Drawing.Point(9, 14); pTablePanel.TabIndex = 0; pTablePanel.Controls.Clear(); pTablePanel.ColumnCount = 2; 返回pTablePanel; }
PictureBox pict;
private void AddtoPbx(Image im)
{
try
{
pict = new PictureBox();
pict.BackColor = System.Drawing.Color.Blue;
pict.Padding = new Padding(2);
pict.Image = m; pict.Width = 100;
pict.Height = 60;
pict.SizeMode = PictureBoxSizeMode.StretchImage;
CheckBox chkBx = new CheckBox();
chkBx.Name = "checkImage";
chkBx.Location = new System.Drawing.Point(40, 40);
pTablePanel.Controls.Add(chkBx, 0, iCount);
pTablePanel.Controls.Add(pict, 1, iCount);
iCount++;
pTablePanel.AutoScroll = true;
System.Threading.Thread.Sleep(50);
pict.Focus();
STA_gbxImages.Controls.Add(pTablePanel);
}
catch (Exception ex)
{ }
}
在这里,我将连续添加 chkbox 和图像.... 现在我的问题是,如果检查了 chkbox,我需要在其他集合中添加相应的图像......如何做到这一点请帮助我......
【问题讨论】:
标签: c#