Android Question B4XDialog

Sergey_New

Well-Known Member
Licensed User
Longtime User
Please tell me how to hide the OK button when opening a custom dialog with an input field. After entering characters, the OK button should appear.
 

Attachments

  • MyDialog.zip
    8 KB · Views: 12
Solution
Here you go

In the Sub Show(title As String,message As String,Ok As String,Cancel As String,No As String, icon As Bitmap) As ResumableSub
Add this line right after the line "Dialog.ShowCustom":
B4X:
    rs = Dialog.ShowCustom(x, Ok, No, Cancel)
    EditName_TextChanged("", "")

And here is the Sub EditName_TextChanged:
B4X:
Sub EditName_TextChanged (Old As String, New As String)
    Dim bt As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
    bt.Visible = (New.Length > 0)
End Sub

vinpolins

Member
Here you go

In the Sub Show(title As String,message As String,Ok As String,Cancel As String,No As String, icon As Bitmap) As ResumableSub
Add this line right after the line "Dialog.ShowCustom":
B4X:
    rs = Dialog.ShowCustom(x, Ok, No, Cancel)
    EditName_TextChanged("", "")

And here is the Sub EditName_TextChanged:
B4X:
Sub EditName_TextChanged (Old As String, New As String)
    Dim bt As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
    bt.Visible = (New.Length > 0)
End Sub
 
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…