Winforms 为什么winform filckers在按钮单击事件中出错
我有一个winform应用程序,它有3个表单,在2个表单中我接受用户输入,Winforms 为什么winform filckers在按钮单击事件中出错,winforms,c#-4.0,Winforms,C# 4.0,我有一个winform应用程序,它有3个表单,在2个表单中我接受用户输入,当用户单击按钮时,我的表单会闪烁(我的意思是它类似的表单消失并出现,有时会将我的应用程序发送到其他应用程序的后面)。谁能告诉我我的申请有什么问题吗?有人在winform中遇到过这种奇怪的行为吗 已编辑 Cursor currentCursor = this.Cursor; try { this.Cursor = Cursors.WaitCursor;
当用户单击按钮时,我的表单会闪烁(我的意思是它类似的表单消失并出现,有时会将我的应用程序发送到其他应用程序的后面)
。谁能告诉我我的申请有什么问题吗?有人在winform中遇到过这种奇怪的行为吗
已编辑
Cursor currentCursor = this.Cursor;
try
{
this.Cursor = Cursors.WaitCursor;
this.btnSave.Enabled = false;
if (isDataModified)
{
if (CheckMandatoryData(mpgUserInfo, ref errorMessage))
{
AppMessageBoxResult appMessageBoxResult =
AppMessageBox.ShowQuestion("Confirmation",
"Do you want to continue?", Environment.NewLine));
if (appMessageBoxResult == AppMessageBoxResult.Yes)
{
if (customerInformation != null)
{
//Assigning value to variable and saving
RefreshData();
}
}
}
else
{
AppMessageBoxResult appMessageBoxResult =
AppMessageBox.ShowQuestion("Confirmation",
"Do you want to continue to save?",
errorMessage, Environment.NewLine));
if (appMessageBoxResult == AppMessageBoxResult.Yes)
{
if (customerInformation != null)
{
//Assigning value to variable and saving
RefreshData();
}
}
errorMessage.Clear();
}
}
}
catch (Exception exception)
{
AppMessageBox.ShowException("Error", exception.Message,
exception.InnerException.Message, exception);
}
finally
{
this.Cursor = currentCursor;
this.btnSave.Enabled = true;
}
这里的
AppMessageBox
是我们的扩展MessageBox
,是我们自定义框架的一部分。我认为您的AppMessageBox中存在焦点/模式对话框问题如果不知道按钮中的代码的作用,很难提供帮助。。。你能发布一些东西吗?你能发布按钮点击处理程序吗?我已经添加了在按钮点击时执行的代码。先生,你能告诉我如何检查吗,因为我有框架的dll。