Shay Well-Known Member Licensed User Longtime User May 10, 2011 #1 dim i as string i="red" Button.color=Colors.i tried few combination without luck
klaus Expert Licensed User Longtime User May 10, 2011 #3 Just Button.Color = Colors.Red Or Dim Red, Green, Blue as Int Red = 255 Green = 0 Blue = 0 Button.Color = Colors,RGB(Red,Green,Blue) Best regards. Upvote 0
Just Button.Color = Colors.Red Or Dim Red, Green, Blue as Int Red = 255 Green = 0 Blue = 0 Button.Color = Colors,RGB(Red,Green,Blue) Best regards.
Shay Well-Known Member Licensed User Longtime User May 10, 2011 #4 is there any simplier way to do this (pass value) this is only example for what I am trying to the main goal is quite more complicated than that Upvote 0
is there any simplier way to do this (pass value) this is only example for what I am trying to the main goal is quite more complicated than that
agraham Expert Licensed User Longtime User May 10, 2011 #5 Simpler way to do what? Your code tried to set a Button's color value and that's what we've showed you. Upvote 0
Simpler way to do what? Your code tried to set a Button's color value and that's what we've showed you.
klaus Expert Licensed User Longtime User May 10, 2011 #6 Shay said: is there any simplier way to do this (pass value) Click to expand... Pass a value to what ? Colors.Red is a constant. Code: the main goal is quite more complicated than that What is your complicated main goal ? You asked a simple question and you got simple answers! If you expect more precise advices you must also expose the problem you want to solve more precisely. Best regards. Upvote 0
Shay said: is there any simplier way to do this (pass value) Click to expand... Pass a value to what ? Colors.Red is a constant. Code: the main goal is quite more complicated than that What is your complicated main goal ? You asked a simple question and you got simple answers! If you expect more precise advices you must also expose the problem you want to solve more precisely. Best regards.
Shay Well-Known Member Licensed User Longtime User May 10, 2011 #7 I will try to explain the problem I have 2 x 10 buttons each 10 buttons must have the same color I have 2 sets of 8 colors, in which i need to choose 2 colors after I choose the color (by pressing the button) the 10 buttons need to get the background color, from what I choose same for the second 10 buttons (total i need to choose 2 colors - 1 of 8 and again 1 of 8 colors) each 10 buttons cannot have the same color as the other 10 Upvote 0
I will try to explain the problem I have 2 x 10 buttons each 10 buttons must have the same color I have 2 sets of 8 colors, in which i need to choose 2 colors after I choose the color (by pressing the button) the 10 buttons need to get the background color, from what I choose same for the second 10 buttons (total i need to choose 2 colors - 1 of 8 and again 1 of 8 colors) each 10 buttons cannot have the same color as the other 10
dealsmonkey Active Member Licensed User Longtime User May 10, 2011 #8 Not tried this so not sure if it will work dim i as string i = "colours.Red" Button.color = i Upvote 0
agraham Expert Licensed User Longtime User May 10, 2011 #9 That won't work. Button.Color needs a Color instance, not a String. Just pass the required Color objects around as Sub parameters or retrurns. Upvote 0
That won't work. Button.Color needs a Color instance, not a String. Just pass the required Color objects around as Sub parameters or retrurns.
klaus Expert Licensed User Longtime User May 10, 2011 #10 How do you choose the colors ? You say you have two sets of 8 colors, how are they defined or where do they come from ? Are the two sets different ? You can define two arrays Dim Colors1(7) as Int Dim Colors2(7) as Int Colors1(0) = Colors.Red Colors1(1) = Colors.Blue . . . Colors2(0) = Colors.Yellow Colors2(1) = Colors.Green . . Button1.Color = Colors1(2) Button2.Color = Colors1(2) . . Button9.Color = Colors2(4) Button10.Color = Colors2(4) Best regards. @dealsmonkey dim i as string i = "colours.Red" Button.color = i this won't work it should be Dim i as Int i = Colours.Red Button.Color = i Best regards. Upvote 0
How do you choose the colors ? You say you have two sets of 8 colors, how are they defined or where do they come from ? Are the two sets different ? You can define two arrays Dim Colors1(7) as Int Dim Colors2(7) as Int Colors1(0) = Colors.Red Colors1(1) = Colors.Blue . . . Colors2(0) = Colors.Yellow Colors2(1) = Colors.Green . . Button1.Color = Colors1(2) Button2.Color = Colors1(2) . . Button9.Color = Colors2(4) Button10.Color = Colors2(4) Best regards. @dealsmonkey dim i as string i = "colours.Red" Button.color = i this won't work it should be Dim i as Int i = Colours.Red Button.Color = i Best regards.