注册 登录
编程论坛 C# 论坛

请问C#中动态生成控件时怎么设置控件位于最底层

mcuee 发布于 2020-09-23 17:17, 1495 次点击
比如:
程序代码:


 List<Label> list = new List<Label>();        

 for (int i = 0; i < count; i++)
{
                Label label = new Label()
                {   Text = "Ch" + (i + 1).ToString(),
                    Size = new Size(50, 30),
                    Font = new Font("Courier New", 10F, FontStyle.Regular, GraphicsUnit.Point, ((Byte)(0))),                                         
                    Location = new Point(110*(xPos)+20, yPos)  
                  //此处如何设置控件位于底层
                };
}
1 回复
#2
mcuee2020-09-24 08:35
自己解决了, 添加TabIndex=0 就行了,数字越小越接近底层
1