B4J Question B4J Snapshot2 - How do I set a button background colour?

AlexOfOz

Active Member
Licensed User
Help please - I must be missing something.

I am trying to set the background colour of a button using Snapshot2, but it simply doesn't want to work. I'm following the instructions as best as I know how, and have been trying now for some weeks, but no success.

An example of my code is bt2(40).Snapshot2(fx.Colors.Red) where bt2(40) is a button.

What am I missing or not understanding?
 

Daestrum

Expert
Licensed User
Longtime User
Snapshot grabs an image of what is on the button, it doesn't set the buttons background colour.
 
Upvote 0

AlexOfOz

Active Member
Licensed User
OH, that would certainly explain it.

Thanks for the clarification; I appreciate it. Back to the drawing board.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
If using a standard button
B4X:
Dim b1 As Button
...
    CSSUtils.SetBackgroundColor(b1,fx.Colors.Red)
...
if using a B4XView type button
B4X:
    Private Button1 As B4XView
...
    Button1.SetColorAndBorder(xui.Color_Green,1.0,xui.Color_Magenta,10.0)
...
 
Upvote 0
Top