Android Question How to delay the appearance of B4XDialog OK button

toby

Well-Known Member
Licensed User
Longtime User
I want to force user to validate input data first, and then once data is validated, OK button would be shown.

I started with the xui_example, and while the dialog is shown, I was able to show/hide the button by executing following line of code:
Hide/Show OK button:
Dialog.GetButton(XUI.DialogResponse_Positive).Visible=False 'True to show and False to hide.

However, the button is shown initially, which is not what I desire. How to keep it hidden until later when it's time to show?
 

toby

Well-Known Member
Licensed User
Longtime User
That does the trick!

Earlier I tried the following code which has no effect:
code that doesn't work:
    Wait For (Dialog.ShowCustom(p, "OK", "", "CANCEL")) Complete (Result As Int)
    Dialog.GetButton(DialogResponse.POSITIVE).Visible =False
 
Upvote 0
Top