Set MsgBox Button combination : MsgBox « GUI « VB.Net Tutorial






Set MsgBox Button combination
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class MsgBoxButtonSetting
   public Shared Sub Main


        Dim Areturn As String
        Areturn = MsgBox("Message", vbOKCancel + vbDefaultButton1 + vbQuestion, "Title")
        'vbOKOnly + vbInformation + vbDefaultButton1
        'vbOKOnly + vbExclamation + vbDefaultButton1
        'vbOKOnly + vbDefaultButton1 + vbCritical
        Select Case Areturn
            Case vbOK
                Console.WriteLine("vbOK")
            Case vbCancel
                Console.WriteLine("vbCancel")
            Case vbAbort
                Console.WriteLine("vbAbort")
            Case vbRetry
                Console.WriteLine("vbRetry")
            Case vbIgnore
                Console.WriteLine("vbIgnore")
            Case Else
                Console.WriteLine("Else")
        End Select
        
   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