Hi,
I have this code to create 4 buttons :
How can I set the disabled image?
Thanks
I have this code to create 4 buttons :
B4X:
For y = 0 To 3
Butt.Initialize("ButtonBT") 'All buttons share the same event sub
Butt.TextSize = testob
Panel5.AddView(Butt,800, 100+150* y, 300dip, 110dip)
ButtonBT(y+1) = Butt 'store a reference to this view
Butt.Tag =y+1
ButtonE(y+1).Initialize(LoadBitmap(File.DirAssets , "gen_butt.jpg"))
ButtonE(y+1).Gravity =Gravity.NO_GRAVITY
ButtonP(y+1).Initialize(LoadBitmap(File.DirAssets , "gen_buttP.jpg"))
ButtonBitmap(y+1).Initialize
Dim states(2) As Int
states(0) = ButtonBitmap(y+1).state_enabled
states(1) = -ButtonBitmap(y+1).state_pressed
ButtonBitmap(y+1).addState2(states, ButtonE(y+1))
Dim states(1) As Int
states(0) = ButtonBitmap(y+1).state_enabled
ButtonBitmap(y+1).addState2(states, ButtonP(y+1))
' Set stdBitmap to button b1
ButtonBT(y+1).Background = ButtonBitmap(y+1)
ButtonBT(y+1).Text = mess(y+52)
Next
How can I set the disabled image?
Thanks