OdyMiles Member Licensed User Feb 28, 2016 #1 Hi everybody, I coded the example (B4ABeginners%20GuideV3_2.pdf) page 122 ( display of a grid with buttons) and modified it. r = Rnd(1,4) Select r Case 1 btn.Color = Colors.Red Case 2 btn.Color = Colors.Blue Case 3 btn.Color = Colors.Green Case 4 btn.Color = Colors.Yellow End Select Click to expand... Then I added a loop in my main activity. Works fine as long as I use a msgbox for creating the next round of buttons - the colors change perfectly. But when I replace the msgbox by a ToastMessageShow no refresh of the buttons are performed, the colors stay the same - probably because there is no click event forcing the refresh? What can I do? Thanks Chris
Hi everybody, I coded the example (B4ABeginners%20GuideV3_2.pdf) page 122 ( display of a grid with buttons) and modified it. r = Rnd(1,4) Select r Case 1 btn.Color = Colors.Red Case 2 btn.Color = Colors.Blue Case 3 btn.Color = Colors.Green Case 4 btn.Color = Colors.Yellow End Select Click to expand... Then I added a loop in my main activity. Works fine as long as I use a msgbox for creating the next round of buttons - the colors change perfectly. But when I replace the msgbox by a ToastMessageShow no refresh of the buttons are performed, the colors stay the same - probably because there is no click event forcing the refresh? What can I do? Thanks Chris
Erel B4X founder Staff member Licensed User Longtime User Feb 29, 2016 #2 Note that it should be Rnd(1, 5) as max parameter is exclusive. Can you upload your project (File - Export as zip)? Upvote 0
Note that it should be Rnd(1, 5) as max parameter is exclusive. Can you upload your project (File - Export as zip)?