Public Sub ButtonSetStateListDrawable(btnBitmap As Button, EnabledBitmap As Bitmap, PressedBitmap As Bitmap, DisabledBitmap As Bitmap)
' Define a bitmap for Enabled state
Dim bdwEnabled As BitmapDrawable
bdwEnabled.Initialize(EnabledBitmap)
' Define a bitmap for Pressed state
Dim bdwPressed As BitmapDrawable
bdwPressed.Initialize(PressedBitmap)
' Define a bitmap for Disabled state
Dim bdwDisabled As BitmapDrawable
bdwDisabled.Initialize(DisabledBitmap)
' Define a StateListDrawable
Dim stdBitmap As StateListDrawable
stdBitmap.Initialize
Dim states(2) As Int
states(0) = stdBitmap.state_enabled
states(1) = -stdBitmap.state_pressed
stdBitmap.addState2(states, bdwEnabled)
Dim states(1) As Int
states(0) = stdBitmap.state_enabled
stdBitmap.addState2(states, bdwPressed)
Dim states(1) As Int
states(0) = stdBitmap.State_Disabled
stdBitmap.addState2(states, bdwDisabled)
' Set stdBitmap to button btnBitmap
btnBitmap.Background = stdBitmap
End Sub