Posted May 13, 201114 yr 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, 201114 yr by CodeRipper
Create an account or sign in to comment