c#多文档主窗体只能对最后创建的子窗体操作 怎么对其他窗体操作。
可以通过 父窗体.MdiChildren[i] 得到某个子窗体。
foreach (子窗体 f in this.MdiChildren)
这样可以遍历所有的子窗体
对其他窗体操作的方法:
1、得到你的窗体,在父窗体中 Form[] form =this.MdiChildren;
2、遍历出所有窗体;foreach (Form 子窗体 in form ),对具体窗体进行操作,
3、当然也可以通过这个Form form = Application.OpenForms[targetFrm.Name]; 方法直接操作子窗体;
利用foreach遍历吧