Hello,
I am almost beginner ...:sign0013:
After loading the image on a button, I want to toggle it's background color Green/Red each time the button is pressed : the image disapear !
Can someone help me ?
Here is my code:
Sub Globals
Dim btnF1 As Button
Dim bm1,bm2 As Bitmap
bm1.Initialize(File.DirAssets,"l.png")
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
New
End Sub
Sub New()
btnF1.text="0"
btnF1.SetBackgroundImage(bm1)
End Sub
Sub btnF1_Click
If btnF1.text=0 Then
btnF1.Color = Colors.RGB(150,227,123)
btnF1.Text="1"
Else
btnF1.Color= Colors.RGB(245,93,47)
btnF1.Text="0"
End If
End Sub
I am almost beginner ...:sign0013:
After loading the image on a button, I want to toggle it's background color Green/Red each time the button is pressed : the image disapear !
Can someone help me ?
Here is my code:
Sub Globals
Dim btnF1 As Button
Dim bm1,bm2 As Bitmap
bm1.Initialize(File.DirAssets,"l.png")
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
New
End Sub
Sub New()
btnF1.text="0"
btnF1.SetBackgroundImage(bm1)
End Sub
Sub btnF1_Click
If btnF1.text=0 Then
btnF1.Color = Colors.RGB(150,227,123)
btnF1.Text="1"
Else
btnF1.Color= Colors.RGB(245,93,47)
btnF1.Text="0"
End If
End Sub