I have a problem with my dialog box, my project has multiple form. When I try to exit the dialog will appear, If will the OkButton the method function as what i want, but if I click CancelButton the from will close itself but the program is still running.
Dim dlg As DialogResult dlg = MessageBox.Show("Are you sure you want to exit?", "Warning!", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) If dlg = Windows.Forms.DialogResult.OK Then Me.Close() : Form1.Show() TeamBox.Items.Clear() : teamBox2.Items.Clear() else 'Do nothing End If
When CancelButton will be hit the current form will close but the project still running because of form1.