The follow codes do not work. When I pressed on the button, its background color did not change at all.
Sub Globals
Dim b As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim cd(3) As ColorDrawable
cd(0).Initialize(Colors.Gray, 5)
cd(1).Initialize(Colors.Blue, 5)
cd(2).Initialize(Colors.Yellow, 5)
Dim sld As State ListDrawable
sld.Initialize
sld.AddState(sld.State_Enabled,ys(1))
sld.AddState(sld.State_Pressed,ys(2))
sld.AddCatchAllState(ys(0))
b.Initialize ("b")
b.Background = sld
Activity.AddView (b,0,0,100,45)
End Sub
Sub Globals
Dim b As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim cd(3) As ColorDrawable
cd(0).Initialize(Colors.Gray, 5)
cd(1).Initialize(Colors.Blue, 5)
cd(2).Initialize(Colors.Yellow, 5)
Dim sld As State ListDrawable
sld.Initialize
sld.AddState(sld.State_Enabled,ys(1))
sld.AddState(sld.State_Pressed,ys(2))
sld.AddCatchAllState(ys(0))
b.Initialize ("b")
b.Background = sld
Activity.AddView (b,0,0,100,45)
End Sub