AlexOfOz Active Member Licensed User Longtime User Jun 22, 2021 #1 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?
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 Jun 22, 2021 #2 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 Longtime User Jun 22, 2021 #3 OH, that would certainly explain it. Thanks for the clarification; I appreciate it. Back to the drawing board. Upvote 0
OH, that would certainly explain it. Thanks for the clarification; I appreciate it. Back to the drawing board.
Daestrum Expert Licensed User Longtime User Jun 22, 2021 #4 If using a standard button Code: Copy Dim b1 As Button ... CSSUtils.SetBackgroundColor(b1,fx.Colors.Red) ... if using a B4XView type button Code: Copy Private Button1 As B4XView ... Button1.SetColorAndBorder(xui.Color_Green,1.0,xui.Color_Magenta,10.0) ... Upvote 0
If using a standard button Code: Copy Dim b1 As Button ... CSSUtils.SetBackgroundColor(b1,fx.Colors.Red) ... if using a B4XView type button Code: Copy Private Button1 As B4XView ... Button1.SetColorAndBorder(xui.Color_Green,1.0,xui.Color_Magenta,10.0) ...