Return value from MsgBox : MsgBox « GUI « VB.Net Tutorial






Return value from MsgBox
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class MsgBoxReturnValue
   public Shared Sub Main
        Dim intReturnValue As Integer
        intReturnValue = MsgBox("This is a message box!",MsgBoxStyle.OKCancel + MsgBoxStyle.Information + MsgBoxStyle.SystemModal, "Message Box")
        If (intReturnValue = MsgBoxResult.OK) Then
            Console.WriteLine("You clicked the OK button.")
        End If

   End Sub
End class








14.59.MsgBox
14.59.1.MsgBox with only message
14.59.2.MsgBox with title and Abort Retry Ignore buttons
14.59.3.MsgBox and vbYesMsgBox and vbYes
14.59.4.Set MsgBox Button combinationSet MsgBox Button combination
14.59.5.Return value from MsgBoxReturn value from MsgBox