我正在monodevelop上创建一个winforms应用程序,但我在编程messagedialogs是/否时遇到问题,特别是:
Gtk.Window main = new Gtk.Window ("MessageDialog");
MessageDialog question = new MessageDialog(main,
DialogFlags.Modal,
MessageType.Question,
ButtonsType.YesNo, "Are you sure you want to quit?");
question.Title="CsoundConverter";
ResponseType response = (ResponseType)question.Run();
question.Show();
if (response == ResponseType.Yes)
{
// some statements
question.Destroy();
}
if (response == ResponseType.Yes)
{
//some statements
question.Destroy();
}
这段代码有什么问题?