0
private void newThumbNail(int docType, string fileName)
{
thmbNail[thmbNailCnt] = new GroupBox();
thmbNail[thmbNailCnt].Parent = panel1;
thmbNail[thmbNailCnt].Visible = true;
thmbNail[thmbNailCnt].Location = new Point(2, 5);
thmbNail[thmbNailCnt].Size = new Size(222, 50);
picBox[thmbNailCnt] = new PictureBox();
picBox[thmbNailCnt].Parent = thmbNail[thmbNailCnt];
picBox[thmbNailCnt].Visible = true;
picBox[thmbNailCnt].Location = new Point(6, 13);
picBox[thmbNailCnt].Size = new Size(31, 31);
//picBox[thmbNailCnt].Image = new Bitmap("images/excel.png");
texBox[thmbNailCnt] = new TextBox();
texBox[thmbNailCnt].Parent = thmbNail[thmbNailCnt];
texBox[thmbNailCnt].Visible = true;
texBox[thmbNailCnt].Location = new Point(53, 24);
texBox[thmbNailCnt].Size = new Size(163, 20);
texBox[thmbNailCnt].Text = fileName;
texBox[thmbNailCnt].Enabled = false;
Controls.Add(thmbNail[thmbNailCnt]);
Controls.Add(picBox[thmbNailCnt]);
Controls.Add(texBox[thmbNailCnt]);
}
這是一個動態添加一個groupBox並在面板內部添加一些控件的函數。不幸的是,它不會出現在面板中。面板是在使用C#設計工具之前手工創建的。它直接放置在15,52的窗口上,尺寸爲279,489。請幫助。將控件放置在面板中的C#