B4J allows you to show modal dialogs or modal forms.
The difference between a modal form to non-modal form is that with a modal form the calling code will only continue after the form is closed.
Showing a modal form is done by calling Form.ShowAndWait.
For example to create a very simple color picker:
ModalForm is a class. Internally it calls Form.ShowAndWait.
Msgbox library is available here: Msgbox library
The difference between a modal form to non-modal form is that with a modal form the calling code will only continue after the form is closed.
Showing a modal form is done by calling Form.ShowAndWait.
For example to create a very simple color picker:
B4X:
Sub btnColor_Action
Dim mf As ModalForm
mf.Initialize(MainForm)
MainForm.BackColor = mf.Show
End Sub
ModalForm is a class. Internally it calls Form.ShowAndWait.
B4X:
Public Sub Show As Paint
frm.ShowAndWait
'The next line will only be executed after the form is closed.
Return colorsMap.Get(lstColors.SelectedItem)
End Sub
Msgbox library is available here: Msgbox library
Attachments
Last edited: