Message Boxes - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Message Boxes

Description:

Initializes variables to pass to the MessageBox.Show method. ... 'Remember that Me is this form class. The message box 'will appear in front of this form. ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 8
Provided by: davidlk2
Category:
Tags: boxes | message | method

less

Transcript and Presenter's Notes

Title: Message Boxes


1
Message Boxes
2
Simple MessageBox
  • Delivers a message to the user.
  • Stops the procedure until the user clicks on OK

3
Private Sub simplemessageButton_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles simplemessageButton.Clic
k MessageBox.Show("This is the message.
It holds up the completion of the event handler
until the user clicks on OK.")
simpleLabel.Text "Done" End Sub
4
Selection MessageBox
5
Private Sub decisionmessageButton_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles decisionmessageButton.Cl
ick ' Initializes variables to pass to
the MessageBox.Show method. Dim Message
As String "You did not enter a server name.
Cancel this operation?" Dim Caption As
String "No Server Name Specified"
'_________________________________________________
__ 'Note that the following specifies
Integers!!! '_____________________________
______________________ Dim Buttons As
Integer MessageBoxButtons. Dim
DefaultButton As Integer MessageBoxDefaultButton
.Button3 Dim BoxOptions As Integer
MessageBoxOptions.RightAlign Dim Result
As DialogResult
6
'Displays a MessageBox using the Question
icon and specifying the No button as the
default. Result MessageBox.Show(Me,
Message, Caption, Buttons, MessageBoxIcon.Question
, _ DefaultButton, BoxOptions)
'Remember that Me is this form class. The
message box 'will appear in front of
this form.
7
'Select Case gets the result of the
MessageBox display and takes action
'depending on the value of the result.
Select Case Result Case
DialogResult.Yes resultLabel.Text
"Yes" Case DialogResult.No
resultLabel.Text "No" Case
DialogResult.Cancel
resultLabel.Text "Cancel" End Select
End Sub
Write a Comment
User Comments (0)
About PowerShow.com