Message Box
IS 125: COMPUTER PROGRAMMING II
INSTRUCTOR: GERALD EMERSON S. CORPIN, MPM
MESSAGE BOX
Displays a pop-up message and prompts the user
to click on a command button
Syntax:
MsgBox(<Message>, <MessageBoxStyle, Icon>, <MessageBoxTitle>)
MESSAGE BOX (cont.)
The basic components of a message box are:
1. Text Message
2. Title Bar
2
3. Message Box Button
4. Icon 4 1
3
MESSAGE BOX ICONS
ICON NAME DESCRIPTION
Information Displays Information Icon
Exclamation Displays Exclamation or warning mark Icon
Question Displays Question Mark Icon
Stop Displays Critical Icon
MESSAGE BOX STYLES
ICON NAME DESCRIPTION
Information Displays Information Icon
MsgBox("This is a Message Box", MsgBoxStyle.Information)
MESSAGE BOX STYLES
ICON NAME DESCRIPTION
Exclamation Displays Exclamation or warning mark Icon
MsgBox("This is a Message Box", MsgBoxStyle.Exclamation)
MESSAGE BOX STYLES
ICON NAME DESCRIPTION
Question Displays Question Mark Icon
MsgBox("This is a Message Box", MsgBoxStyle.Question)
MESSAGE BOX STYLES
ICON NAME DESCRIPTION
Stop Displays Critical Icon
MsgBox("This is a Message Box", MsgBoxStyle.Critical)
MESSAGE BOX STYLES / RESPONSES
MsgBox("This is a Message Box", MsgBoxStyle.OkOnly)
MsgBox("This is a Message Box", MsgBoxStyle.OkCancel)
MsgBox("This is a Message Box", MsgBoxStyle.AbortRetryIgnore)
MsgBox("This is a Message Box", MsgBoxStyle.YesNo)
MsgBox("This is a Message Box", MsgBoxStyle.YesNoCancel)
MsgBox("This is a Message Box", MsgBoxStyle.RetryCancel)
Activity
Controls:
2 Labels (Labeled as Username, Password)
2 Textbox
1 button (Labeled as Submit)
Design your VB.NET program wherein if username and password is correct, a
message box (“OK” button only, use “Information” Icon) will be displayed:
“Username and Password matched”
Else
“Invalid Username and Password”