我想你正在寻找GetChildIndex,这将给你控件的z-oder的价值.因此,您可以在当前表单控件集合中为每个子控件测试此值,然后:
索引值为零的控件位于z顺序的顶部,而较高的数字更接近底部.
就像是:
foreach (Control x in parent.Controls)
{
if(parent.Controls.GetChildIndex(x) == 0)
{
//x is the front most control
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3048 次 |
| 最近记录: |