Class
MobileMessageBox
Description
Used to asynchronously display alerts.
Property descriptions
MobileMessageBox.Message
Message As String
A longer message that appears below the title in the message box.
Set the message:
MessageBox1.Message = "Would you like to update this information?"
MobileMessageBox.Name
Name As String
The name of the control.
MobileMessageBox.Title
Title As String
The title of the message box, which appears at the top.
Set the title:
MessageBox1.Title = "Warning"
Method descriptions
MobileMessageBox.Handle
Handle As Ptr
The a handle to the underlying native OS control.
MobileMessageBox.Show
Show
Displays the message box. This is not modal, so your code continues to run. When the user selects a button, the Pressed event handler is called.
Displays a message box. HelloMessage is a MobileMessageBox that was dragged onto the Screen from the Library:
HelloMessage.Title = "Hello"
HelloMessage.Message = "Hello, World!"
HelloMessage.Show // Not modal, so code does not pause here
Event descriptions
MobileMessageBox.Closing
Closing
Called when the control’s layout is closing.
MobileMessageBox.Opening
Opening
Called when the control’s layout is opening.
This is where you typically put initialization code.
This example in the Opening event of a label sets its text to “Hello”:
Me.Text = "Hello"
MobileMessageBox.Pressed
Pressed(buttonIndex As Integer)
Called when the button at buttonIndex is selected.
Displays the index of the selected button:
Label1.Text = "You selected button " + buttonIndex.ToString
Notes
MobileMessageBox is asynchronous, any code after the Show method is executed after the message box is displayed. Use the Pressed event handler to get the results of a button selection and to run code based on the selection.
Ios ui guidelines
Apple provides user interface guidelines for the text and buttons in a MessageBox.
Compatibility
Mobile projects on all supported mobile operating systems.
See also
MobileControl parent class; MessageBox method, MobilePopupMessage class.