Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("MyLayoutFile")
' I need the button to be round
Dim nRadius As Int
nRadius = DipToCurrent((BtnSave.Height + BtnSave.Width)/2)
Dim EnabledClr,PressedClr,DisabledClr As ColorDrawable
EnabledClr.Initialize(Colors.Blue, nRadius)
DisabledClr.Initialize(Colors.Red, nRadius)
PressedClr.Initialize(Colors.Green, nRadius)
'Create StateListDrawable
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Enabled,EnabledClr)
sld.AddState(sld.State_Disabled,DisabledClr)
sld.AddState(sld.State_Pressed,PressedClr)
BtnSave.Background = sld
'Here I expect the button to be displayed in the Disabled Color
BtnSave.Enabled = False
End Sub
Sub BtnSave_Click
Dim nResponse As Int
nResponse = Msgbox2("Shall I save this data ?","Confirmation required","Yes","","No",Null)
If nResponse = DialogResponse.POSITIVE Then
Msgbox("Saved","OK")
Else
Msgbox("Not Saved","NOT OK")
End If
End Sub