winform 控件置顶
我们知道要把一个控件置顶的话一般有两种方法,一种是直接在界面里选中控件-》右键-》置于顶层
另外一种是在界面初始化的时候使用BringToFront方法。
这里主要介绍第三种方法SetChildIndex:
this.Controls.SetChildIndex(label1, 0);
为了获取控件当前的索引,可以使用GetChildIndex方法。
int nZorder = this.Controls.GetChildIndex(label1, true);
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。