Program On Predefined Dialogue Box in VB

This is a VB 6.0 Application program for predefined Dialog box.

Program On Predefined Dialogue Box

In properties window change the control caption as follows:
Caption
Name
File
Mnufile
Display
Mnudisplay
Date
Mnudate
Exit
Mnuexit
DESIGN VIEW:
 
CODING:
Private Sub mnudate_Click()
Dim i, day, msg
i = InputBox("enter a date:", "datedemo")
If Not IsDate(i) Then
MsgBox "invalid date"
Exit Sub
End If
day = Format(i, "ddd")
msg = "day of this date:" + day
MsgBox msg
End Sub
Private Sub mnudisplay_Click()
Dim message As String
Dim dialogtype As Integer
Dim title As String
message = "have a gala shopping"
dialogtype = vbOK + vbInformation
title = "welcome to the supermarket"
MsgBox message, dialogtype, title
End Sub
Private Sub mnuexit_Click()
Dim message As String
Dim title As String
Dim dialogtype As Integer
Dim response As Integer
message = "thank you,visit again"
dialogtype = vbYesNo + vbInformation
title = "goodbye"
reponse = MsgBox(message, dialogtype, title)
If response = vbYes Then
End If
End Sub

OUTPUT 1:
 
OUTPUT 2:
OUTPUT 3:
 
Post a Comment

Program On Predefined Dialogue Box in VB

This is a VB 6.0 Application program for predefined Dialog box.

Program On Predefined Dialogue Box

In properties window change the control caption as follows:
Caption
Name
File
Mnufile
Display
Mnudisplay
Date
Mnudate
Exit
Mnuexit
DESIGN VIEW:
 
CODING:
Private Sub mnudate_Click()
Dim i, day, msg
i = InputBox("enter a date:", "datedemo")
If Not IsDate(i) Then
MsgBox "invalid date"
Exit Sub
End If
day = Format(i, "ddd")
msg = "day of this date:" + day
MsgBox msg
End Sub
Private Sub mnudisplay_Click()
Dim message As String
Dim dialogtype As Integer
Dim title As String
message = "have a gala shopping"
dialogtype = vbOK + vbInformation
title = "welcome to the supermarket"
MsgBox message, dialogtype, title
End Sub
Private Sub mnuexit_Click()
Dim message As String
Dim title As String
Dim dialogtype As Integer
Dim response As Integer
message = "thank you,visit again"
dialogtype = vbYesNo + vbInformation
title = "goodbye"
reponse = MsgBox(message, dialogtype, title)
If response = vbYes Then
End If
End Sub

OUTPUT 1:
 
OUTPUT 2:
OUTPUT 3:
 
Post a Comment