Android Question visible and invisible buttons with 2 click

Zakariya

New Member
hi guys
i made a button and when i pressed it show 2 other buttons now how can i invisible that 2 other buttons if again pressed that button
thanks guys
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub Globals
   Dim ButtonsVisible As Boolean = False
End Sub
Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Button2.Visible = ButtonsVisible
   Button3.Visible = ButtonsVisible
   
End Sub

Sub Button1_Click
   If ButtonsVisible = True Then
     ButtonsVisible = False
   Else
     ButtonsVisible = True
   End If
   Button2.Visible = ButtonsVisible
   Button3.Visible = ButtonsVisible
End Sub
 

Attachments

  • buttonsvisibletest.zip
    6.9 KB · Views: 177
Upvote 0
Top