Hi,
has someone figured out a way to update the appearance of a form more than once during runtime? It seems like no matter what I do with it, you only see the final version when the code is through.
What I am trying to do is for example to let a warning message flash.
like:
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;
SLEEP(300);
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;
SLEEP(300);
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;
This does not work obviously but you know what I mean. Any ideas?
Thanks!
Comments
The Form property is TimerInterval, set the interval you want for it.
And in the code "Form - OnTimer()" write the changes for that variable, think it's best, but 300 ms of interval wouldn't be too fast? It's something like 1/3 of second...
my source for this was:
auto refresh form
Read it also and see if it might be of some help
For example I would need acertain control to appear and disapear (flash) a couple of times during runtime, not when the form is idle. Like a lo-tec animation if you will ...
There are ways to use the timer but I find none of them very elegant ...
The loop of update -> sleep, could it interest you?
I am not quite sure if I understand your suggestion correctly but the problem is that the window does not actuallyupdate its appearance until the code is through. So this means that if I use the code from my first post the window just sleeps for a second and a half (5 x 300ms) and then changes it's appearance to the way it was told in the last command (In this case the control is hidden). The update function has no effect as long as the code is performed.
Senior NAV Developer
Elbek & Vejrup
It's a discution in here but they explored several cases and might be a logic that you can adapt to your solution.
And would be a matter to get the timer for the progress bar to work
But the basis of he progress window for you would be:
Repeat
-> update information on the progress window
-> sleep(x miliseconds)
Until
the basis to use it is when you are updating a lot of information you use the progress window to show the % done so the user don't think NAV crashed or something, but I think it can be adapted for your scenario.