动态创建控件的显示问题
如下代码:
//
// pnlPhone
//
pnlPhone = new Panel();
pnlPhone.BackColor = System.Drawing.Color.FromArgb(255, 204, 204, 204);
pnlPhone.Location = new System.Drawing.Point(28, 20);
pnlPhone.Margin = new System.Windows.Forms.Padding(2);
pnlPhone.Name = "pnlPhone";
pnlPhone.Size = new System.Drawing.Size(405, 303);
pnlPhone.TabIndex = 27;
pnlPhone.BorderStyle = BorderStyle.FixedSingle;
//
//pnlTime
//
pnlTime = new Panel();
pnlTime.BackColor = System.Drawing.Color.Red;
pnlTime.Location = new System.Drawing.Point(28, 20);
pnlTime.Margin = new System.Windows.Forms.Padding(2);
pnlTime.Name = "pnlTime";
pnlTime.Size = new System.Drawing.Size(405, 50);
controlForm是一个窗体:
controlForm.Controls.Add(this.pnlPhone);
controlForm.Controls.Add(this.pnlTime);
现在的问题是pnlTime显示不出来,貌似是被pnlPhone遮挡了。 该如何解决
------解决方案--------------------