Android Question How can I change the text of a Label when I press a Button?

Kenny Ali

Member
Licensed User
I´m new at this. Literally only one week on it, and I don´t know how to change the text of a label when I press a Button.
At Visual Basic I just have to Click twice at the button and it open me the code space and write:
" Label1.Text="Text" ".
As simple as that, but I don´t know how to do it at B4A.
Can you please help me out?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I recommend you to start with the beginner's guide: https://www.b4x.com/android/documentation.html

Right click on the label in the designer -> generate -> Dim label...
Right click on the button in the designer -> generate -> click.

It will create a sub similar to:
B4X:
Sub Button1_Click
 Label1.Text = "Text"
End Sub
 
Upvote 0
Top