Wish Pressed Button Background color

yiankos1

Well-Known Member
Licensed User
Longtime User
Yes:
B4X:
Sub SetPressedBackgroundColor(Color As Int, B As Button)
    Dim P As Panel
    P.Initialize("")
    P.Color = Color
    P.Width = B.Width
    P.Height = B.Height

    Dim C As Canvas
    C.Initialize(P)

    Dim NaObj As NativeObject = B
    NaObj.RunMethod("setBackgroundImage:forState:", Array(C.CreateBitmap, 1))
End Sub

Jan

Some day, maybe this method could be added at designer.
 
Top