Monday, December 10, 2012

Input output function in visual basic


Private Sub CmdMsgst_Click()
MsgBox "This is a msgbox statement", vbOKCancel + vbInformation, "Hii…"
End Sub

Private Sub CmdMsgFun_Click()
Dim res As Integer
res = MsgBox("Is it is a msgbox function....?", vbQuestion + vbYesNo, "Hello")
If res = vbYes Then
MsgBox "welcome"
Form1.Show
ElseIf res = vbNo Then
End
End If
End Sub
Private Sub CmdINOUT_Click()
Dim str As String
str = InputBox("Enter city name: ", "Plz enter name...", "HISAR", 2500, 3500)
End Sub
Private Sub CmdExit_Click()
End
End Sub 




 Output

Note:- Please set some property of your control like caption or id corresponding to your control
Goto Visual Basic Programs Index Page