ANDHRA PRADESH
Name of the faculty : G. Radha
Designation : Lecturer
Branch : CCP
Institute : 026 - SG Govt. Polytechnic,
Adilabad
Year / Semester : III Year / V Semester
Subject : Visual Basic – I
Subject Code : CCP - 503
Topic : Understand Menus and Common
dialogue control .
Duration : 50 Mts.
Sub Topic : Common Dialogue Control.
Teaching Aids : Animations & Images
CCP-503.18 1
Recap
Dialogue Boxes in Visual Basic.
CCP-503.18 2
Objectives :
Upon the completion of this period,
you will be able to understand about
Predefined Dialogue Boxes.
CCP-503.18 3
Predefined Dialogue Boxes
CCP-503.18 4
Design a small program with MsgBox()
function
MsgBox() function is used to display messages on
the Form.
CCP-503.18 5
Design a small program with MsgBox()
function
CCP-503.18 6
Design a small program with MsgBox()
function
CCP-503.18 7
Design a small program with MsgBox()
function
Caption Name
&File MnFile
….D&isplay MnDisplay
- MnSep1
….E&xit MnExit
CCP-503.18 8
Design a small program with MsgBox()
function
CCP-503.18 9
Design a small program with MsgBox()
function
Private Sub MnDisplay_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 Super Market"
MsgBox Message, DialogType, Title
End Sub
CCP-503.18 10
Design a small program with MsgBox()
function
CCP-503.18 11
Design a small program with MsgBox()
function
CCP-503.18 12
Design a small program with MsgBox()
function
CCP-503.18 13
Design a small program with MsgBox()
function
Private Sub MnExit_Click()
Dim Message As String
Dim DialogType As Integer
Dim Title As String
Dim Response As Integer
Message = "Thank You, Visit Again"
DialogType = vbYesNo + vbInformation
Title = "Good Bye"
Response = MsgBox(Message, DialogType, Title)
If Response = vbYes Then
End
End If
End Sub
CCP-503.18 14
Design a small program with MsgBox()
function
CCP-503.18 15
Design a small program with MsgBox()
function
The MnExit_Click procedure updates the variables
Message, DialogType and Title. Once these three
variables are updated MsgBox() function is executed
and its returned value is assigned to the variable
Response.
The returned value of the MsgBox() function
indicates the button that was clicked.
CCP-503.18 16
Design a small program with MsgBox()
function
The MsgBox() function takes the same parameters
as the MsgBox statement.
CCP-503.18 17
Using InputBox() Function
It displays a Modal Dialogue Box that asks the user
to enter some data.
The user can type in the Text Box and close the
Dialogue Box by clicking OK.
CCP-503.18 18
Syntax of InputBox() Function
InputBox(Message, Title)
For example :
CCP-503.18 19
Design a small program with InputBox()
function
Caption Name
….Get&Date MnDate
….Get&Value MnValue
- MnSep2
CCP-503.18 20
Design a small program with InputBox()
function
CCP-503.18 21
Design a small program with InputBox()
function
CCP-503.18 22
Design a small program with InputBox()
function
CCP-503.18 24
Design a small program with InputBox()
function
CCP-503.18 25
Design a small program with InputBox()
function
If the Date is entered is a valid one such as
18/10/1974, the user is prompted with a message
box indicating the day of that date.
CCP-503.18 26
Summary
We have discussed about :
CCP-503.18 27
Quiz
CCP-503.18 28
1. ________ and _______ functions are used
to add predefined dialogue boxes.
CCP-503.18 29
2. Predefined Dialogue Boxes are always ______
Dialogue Boxes.
CCP-503.18 30
Frequently Asked Questions
CCP-503.18 31
Assignment
CCP-503.18 32