111,128
社区成员
发帖
与我相关
我的任务
分享private void AddMyOwnedForm()
{
// Create form to be owned.
Form ownedForm = new Form();
// Set the text of the owned form.
ownedForm.Text = "Owned Form " + this.OwnedForms.Length;
// Add the form to the array of owned forms.
this.AddOwnedForm(ownedForm);
// Show the owned form.
ownedForm.Show();
}
private void ChangeOwnedFormText()
{
// Loop through all owned forms and change their text.
//循环父窗体拥有的子窗口,识别出子窗体即可。
for (int x = 0; x < this.OwnedForms.Length; x++)
{
this.OwnedForms[x].Text = "My Owned Form " + x.ToString();
}
}
public static bool flag{get; private set;}
子窗体初始化时与关闭子窗体时分别赋值,在父窗体中判断。