以下适用于 Windows 窗体。
当子窗体关闭时,它只是使用委托来重新激活父窗体上的 GroupBorder 。
private void uxUpdateDataButton_Click(object sender, EventArgs e)
{
uxRevisionHelperGroupBox.Enabled = false;
uxBindingNavigator.Hide();
uxFormDatabase myNewDisplay = new uxFormDatabase();
myNewDisplay.FormClosed += delegate { activateGroupBorder(); };
myNewDisplay.Show();
}
public void activateGroupBorder()
{
uxRevisionHelperGroupBox.Enabled = true;
uxBindingNavigator.Show();
}
除了消息框而不是子表单之外,是否可以执行与上述等效的操作?
这是我的尝试,不是解决方案:
private void uxAuthorPictureBox_Click(object sender, EventArgs e)
{
uxRevisionHelperGroupBox.Enabled = false;
uxBindingNavigator.Hide();
MessageBox myMessage = new MessageBox;
myMessage.close += delegate { activateGroupBorder(); };
myMessage.Show("hello world");
}
public void activateGroupBorder()
{
uxRevisionHelperGroupBox.Enabled = true;
uxBindingNavigator.Show();
}