P Peter Lewis Well-Known Member Licensed User Longtime User Dec 13, 2016 #1 Hi I have been trying for hours and searching all over the place for a solution for this problem. I have 8 labels on the screen that I want to flash randomly on the screen and then stop on one of them. The problem is the screen does not refresh so I cannot see the flashes. All I see is the end result. In other languages that I have used , I can either refresh the Object / Field after updating it or refresh the whole screen. If you have any ideas how I could refresh the screen I would appreciate it. I only started programming with this language today even though I have purchased it over 3 years ago and also paid for the update. Thank you in advance
Hi I have been trying for hours and searching all over the place for a solution for this problem. I have 8 labels on the screen that I want to flash randomly on the screen and then stop on one of them. The problem is the screen does not refresh so I cannot see the flashes. All I see is the end result. In other languages that I have used , I can either refresh the Object / Field after updating it or refresh the whole screen. If you have any ideas how I could refresh the screen I would appreciate it. I only started programming with this language today even though I have purchased it over 3 years ago and also paid for the update. Thank you in advance
MitchBu Well-Known Member Licensed User Longtime User Dec 13, 2016 #2 Code: Label1.Invalidate But if you are trying to flash the labels within the same sub/event in a loop, you may need to add DoEvents. Or cycle the labels in a timer instead. Upvote 0
Code: Label1.Invalidate But if you are trying to flash the labels within the same sub/event in a loop, you may need to add DoEvents. Or cycle the labels in a timer instead.
P Peter Lewis Well-Known Member Licensed User Longtime User Dec 13, 2016 #3 MitchBu said: Code: Label1.Invalidate But if you are trying to flash the labels within the same sub/event in a loop, you may need to add DoEvents. Or cycle the labels in a timer instead. Click to expand... I did try Label1.Invalidate but it did not work. Thank you for steering me in the right direction I will keep trying I tried a for-next look and also a Delay sub Upvote 0
MitchBu said: Code: Label1.Invalidate But if you are trying to flash the labels within the same sub/event in a loop, you may need to add DoEvents. Or cycle the labels in a timer instead. Click to expand... I did try Label1.Invalidate but it did not work. Thank you for steering me in the right direction I will keep trying I tried a for-next look and also a Delay sub
P Peter Lewis Well-Known Member Licensed User Longtime User Dec 13, 2016 #5 Cableguy said: DoEvents may also be needed! Click to expand... Thank you Upvote 0
klaus Expert Licensed User Longtime User Dec 13, 2016 #6 As MichBu already suggested you should use a Timer. How do you access the Labels, do you use an array of Labels? Upvote 0
As MichBu already suggested you should use a Timer. How do you access the Labels, do you use an array of Labels?
P Peter Lewis Well-Known Member Licensed User Longtime User Dec 13, 2016 #7 DoEvents was exactly what I was looking for , Thank you again Upvote 0
P Peter Lewis Well-Known Member Licensed User Longtime User Dec 13, 2016 #8 klaus said: As MichBu already suggested you should use a Timer. How do you access the Labels, do you use an array of Labels? Click to expand... I am going to put the labels into an array and then use a RNG to choose one at a time and flash it. I am also going to make the first 2 second flash fast between them and then slow it down until it stops at the last one. Upvote 0
klaus said: As MichBu already suggested you should use a Timer. How do you access the Labels, do you use an array of Labels? Click to expand... I am going to put the labels into an array and then use a RNG to choose one at a time and flash it. I am also going to make the first 2 second flash fast between them and then slow it down until it stops at the last one.
Erel B4X founder Staff member Licensed User Longtime User Dec 14, 2016 #9 DoEvents is not the correct solution. You should use a timer or CallSubPlus: https://www.b4x.com/android/forum/threads/60877/#content Upvote 0
DoEvents is not the correct solution. You should use a timer or CallSubPlus: https://www.b4x.com/android/forum/threads/60877/#content
P Peter Lewis Well-Known Member Licensed User Longtime User Dec 14, 2016 #10 Erel said: DoEvents is not the correct solution. You should use a timer or CallSubPlus: https://www.b4x.com/android/forum/threads/60877/#content Click to expand... Hi Erel Thank you for the advice. I just needed to do a mockup to show the client. If I get the job to do I will use your solution. Regards Peter Upvote 0
Erel said: DoEvents is not the correct solution. You should use a timer or CallSubPlus: https://www.b4x.com/android/forum/threads/60877/#content Click to expand... Hi Erel Thank you for the advice. I just needed to do a mockup to show the client. If I get the job to do I will use your solution. Regards Peter