CodeExplorer Posted May 13, 2011 Posted May 13, 2011 (edited) Msgbox Samples For Vb.netMessageBox OK:MessageBox.Show("message", "caption", MessageBoxButtons.OK, MessageBoxIcon.Hand)MessageBox AbortRetryIgnore:Dim answer = MessageBox.Show("message", "caption", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Hand)If answer = DialogResult.Abort Then' Do abort processing here...ElseIf answer = DialogResult.Retry Then' Do retry processing here...Else 'It has to be ignore' Do ignore processing here...End IfMessageBox OKCancel:Dim answer = MessageBox.Show("message", "caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Hand)If answer = DialogResult.ok Then' Do ok processing here...Else 'It has to be cancel' Do cancel processing here...End IfMessageBox RetryCancel:Dim answer = MessageBox.Show("message", "caption", MessageBoxButtons.RetryCancel, MessageBoxIcon.Hand)If answer = DialogResult.Retry Then' Do Retry processing here...Else 'It has to be cancel' Do cancel processing here...End IfMessageBox YESNO:Dim answer = MessageBox.Show("message", "caption", MessageBoxButtons.YesNo, MessageBoxIcon.Hand)If answer = DialogResult.Yes Then' Do Yes processing here...Else 'It has to be cancel' Do No processing here...End IfMessageBox YesNoCancel:Dim answer = MessageBox.Show("message", "caption", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Hand)If answer = DialogResult.Yes Then' Do Yes processing here...ElseIf answer = DialogResult.No Then' Do No processing here...Else 'It has to be cancel' Do ignore processing here...End If Edited May 13, 2011 by CodeRipper 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now