Android Question Which function in B4A is similar to the “inputbox” function in VB?

bskotu555

Member
Which function in B4A is similar to the “inputbox” function in VB? I need to click the button, enter the content in the pop-up window, and change the Text of the button to the input content,thank you!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private Button1 As B4XView
    Private Dialog As B4XDialog
    Private InputTemplate As B4XInputTemplate
End Sub

Public Sub Initialize
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    Dialog.Initialize(Root)
    InputTemplate.Initialize
    InputTemplate.lblTitle.Text = "Enter button text"
End Sub

Private Sub Button1_Click
    Wait For (Dialog.ShowTemplate(InputTemplate, "Ok", "", "Cancel")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Button1.Text = InputTemplate.Text
    End If
End Sub

Add a reference to XUI Views in the libraries tab.
 
Upvote 1

bskotu555

Member
Dear moderator, I tested the code and when I long press the button, these logs appear. I don't quite understand what happened?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…