我有很多像這樣的代碼,它通常工作MessageBox.Show問題
private void button_Click(object sender, EventArgs e)
{
try
{
DialogResult result;
result = MessageBox.Show("Questa operazione potrebbe richiedere alcuni minuti,\r\nsei sicuro di voler continuare?", "Attenzione", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == System.Windows.Forms.DialogResult.Yes)
{
DoSomething();
}
else
{
DoSomethingElse();
}
}
Catch (Exception ex)
{
LogExceptio(ex);
}
}
但在特定Windows Form
的MessageBox
某些原因沒有顯示。 如果我按輸入它繼續像我點擊YES; 如果我按ALT鍵,那麼MessageBox奇蹟般地出現在屏幕上。
有什麼想法? 我能做些什麼來解決這個問題?
更新:在'Form'我有一個'DataGridView'和看來, 'MessageBox'問題僅在我有一些彩色行時出現,我在'RowPrePaint'事件中着色。 – Shyguy
其實我已經評論過'DataRow.Cells [「cell」] .value = false;'在我的'DataGridView_RowPrePaint'中,並且所有的工作都是按照必要的。 – Shyguy