您好,我在验证某些数据时会调用 MessageBox,如果数据错误,我会使用 MessageBox 向用户发送消息,其中包含以下代码:
private void button1_Click(object sender, EventArgs e)
{
if (textBox_name.Text.Trim() != ""
|| textBox_X.Text.Trim() != ""
|| textBox_Y.Text.Trim() != "")
{
if (graph.getNodoNome(textBox_nome.Text.Trim()) != null)
{
MessageBox.Show("Data is wrong?", "Error");
resetTextBoxes();
return;
}
// randome stuff
}
}
当我删除 MessageBox 时,我的应用程序崩溃了。谢谢您的帮助
编辑:整个方法的 Pastebay 链接http://pastebay.com/82690