void MainWindow::button2_click(void*, EventArgs&) { AboutDialog dlg; if (dlg.showDialog(this) == OK) { int x = 0; x++; } }