How do i backout from a messagebox prompt if i select "NO"?

you should have realised that the "cancel" property was what were on my mind in the first place
If you'd just pause you fingers momentarily long enough to give your brain a chance, you might have seen that I did actually realise this and wrote the following as a result of my realisation:
VB.NET:
FormClosing

  If MessageBox.Show("Sure to quit?", "", MessageBoxButtons.YesNo) == DialogResult.No
    [B][SIZE="5"]e.Cancel = True 'set the event cancel property to prevent app exiting[/SIZE][/B]
  End If

End FormClosing

Hope it helped! :D:D


BTW, the "exit sub" will truly exit the sub and will not run over the old lady crossing the road. Believed me


If you do nothing else than write Exit Sub in the sub that handles the FormClosing event, then the form will still close, because the form is destined to close when the sub exits. Exit Sub has NO effect on whether a form will close or not :rolleyes::rolleyes:
 
Back
Top