在C#中,activeMdichild是什么?
1 回答
慕尼黑的夜晚无繁华
TA贡献1864条经验 获得超6个赞
.NET Framework 类库
Form.ActiveMdiChild 属性
获取当前活动的多文档界面 (MDI) 子窗口。
命名空间:System.Windows.Forms
程序集:System.Windows.Forms(在 system.windows.forms.dll 中)
语法:public Form ActiveMdiChild { get; }
示例:
public void ClearAllChildFormText()
{
// Obtain a reference to the currently active MDI child form.
Form tempChild = this.ActiveMdiChild;
// Loop through all controls on the child form.
for (int i = 0; i < tempChild.Controls.Count; i++)
{
// Determine if the current control on the child form is a TextBox.
if (tempChild.Controls[i] is TextBox)
{
// Clear the contents of the control since it is a TextBox.
tempChild.Controls[i].Text = "";
}
}
}
- 1 回答
- 0 关注
- 1306 浏览
添加回答
举报
0/150
提交
取消