我有winform app有3种形式,有2种形式,我正在接受用户输入和when user click button my form flickers (i means its like form disappear and appears, and sometimes sends my app to back of other app)
。谁能告诉我我的申请有什么问题?有没有人在winform中遇到过这种奇怪的行为?
EDITED
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
,是我们自定义框架的一部分。
答案 0 :(得分:0)
我认为您在AppMessageBox中有焦点/模态对话框问题