For starters, I'd suggesting using MessageBox.Show instead...
Secondly, if you then read the documentation you'll find out that it is a function... which means it returns the value ... so it works like this:
-tgCode:Dim result = MessageBox.Show(message, caption, _ MessageBoxButtons.YesNo, _ MessageBoxIcon.Question) ' If the no button was pressed ... If (result = DialogResult.No) Then ' cancel the closure of the form. e.Cancel = True End If




Reply With Quote
