Simple message box:
Message box with result:
Note that you can pass "" as the button text to hide a button.
InputList:
The message icon is the same as the owner form icon.
B4X:
fx.Msgbox(MainForm, "This is the message", "This is the title")
Message box with result:
B4X:
Dim res As Int = fx.Msgbox2(MainForm, "Do you want to save changes?", "Save", _
"Yes", "Cancel", "No", fx.MSGBOX_WARNING)
If res = fx.DialogResponse.POSITIVE Then
Log("Saving changes...")
End If
Note that you can pass "" as the button text to hide a button.
B4X:
fx.Msgbox2(MainForm, "Invalid value!", "Error", "I will not do it again", "", "", fx.MSGBOX_ERROR)
InputList:
B4X:
Dim items As List = Array("Item #1", "Item #2", "Item #3", "Item #4")
Dim res As Int = fx.InputList(MainForm, items, "Please choose an item", "Items", 0)
If res >= 0 Then
Log($"Selected item: ${items.Get(res)}"$)
Else
Log("User didn't select any item.")
End If
The message icon is the same as the owner form icon.