dim button1 as button
dim button2 as button
Dim cdGreenColorEnabled As ColorDrawable
cdGreenColorEnabled.Initialize(Colors.yellow,10)
' Define a color for Pressed state
Dim cdGreenColorPressed As ColorDrawable
cdGreenColorPressed.Initialize(Colors.Red,10)
' Define a StateListDrawable
Dim stdGreenColor As StateListDrawable
stdGreenColor.Initialize
Dim states(2) As Int
states(0) = stdGreenColor.state_enabled
states(1) = -stdGreenColor.state_pressed
stdGreenColor.addState2(states, cdGreenColorEnabled)
Dim states(1) As Int
states(0) = stdGreenColor.state_pressed
stdGreenColor.addState2(states, cdGreenColorPressed)
' Set stdGreenColor to button background
button1.Background = stdGreenColor