B4J Question [SOLVED] B4xDialog4Button. Different colors for buttons

PaulMeuris

Active Member
Licensed User
Yes, you can.
In the subroutines (Show, ShowCustom, ShowTemplate) from the class B4xDialog4Button you can change the 2 commented lines with the highlighted lines:
B4X:
        Dim XB4x As B4XView = Btn
        Dim R As Int = Rnd(150,250)
        Dim G As Int = Rnd(150,250)
        Dim B As Int = Rnd(150,250)
        XB4x.Color = XUI.Color_ARGB(255,R,G,B)
        XB4x.TextColor = XUI.Color_Black
'        XB4x.Color = mDialog.ButtonsColor
'        XB4x.TextColor = mDialog.ButtonsTextColor
If you set the button color to a dark color then you might want to use a contrast color (e.g. white) for the text color.
 
Upvote 0
Top