G
Guest
Hi,
I've been struggling to get my form to refresh during the loading of large
objects on startup of my application.
I'm trying to get an image sequence to cycle on a splash screen during this
loading as the whole process takes ~1 minute.
The object loading code is in the Form_Load event and any time I call
this.Refresh() in this method it works as expected. The problem is that one
of my objects is extremely large (takes >30 seconds to load from the
database) so I'm trying to get an "I'm still alive" indicator to move during
the loading of this object. The object itself is loaded into a singleton so I
can't pass a delegate or have the form attach to an EventHandler (which I
would raise an event against inside the object loading code to indicate
progress).
The Windows.Forms.Timer seems to be utterly useless (doesn't fire at all
until the Load event is complete) and I have tried the System.Threading.Timer
which fires fine but the this.Refresh() call has absolutely no effect on the
display.
The "I'm still alive" image sequence is in a 'View' control which has an
ActiveIncrement method that changes which image is displayed. I tried having
an Event raised in this method that the Form attaches to and calls
Form.Refresh(). This works fine when the ActiveIncrement is called in the
Form_Load event code but does not work when it is called in the
Threading.Timer code. Note: the this.Refresh() is called every time it just
has no visual effect when called in the Timer code.
What the hell is going on!!!??!!!!!?!?!?! Is there some sort of threading
issue that is preventing the form from invalidating? Does anyone have a
method for periodically updating the form display during start up code?
Cheers,
Peter Mauger
I've been struggling to get my form to refresh during the loading of large
objects on startup of my application.
I'm trying to get an image sequence to cycle on a splash screen during this
loading as the whole process takes ~1 minute.
The object loading code is in the Form_Load event and any time I call
this.Refresh() in this method it works as expected. The problem is that one
of my objects is extremely large (takes >30 seconds to load from the
database) so I'm trying to get an "I'm still alive" indicator to move during
the loading of this object. The object itself is loaded into a singleton so I
can't pass a delegate or have the form attach to an EventHandler (which I
would raise an event against inside the object loading code to indicate
progress).
The Windows.Forms.Timer seems to be utterly useless (doesn't fire at all
until the Load event is complete) and I have tried the System.Threading.Timer
which fires fine but the this.Refresh() call has absolutely no effect on the
display.
The "I'm still alive" image sequence is in a 'View' control which has an
ActiveIncrement method that changes which image is displayed. I tried having
an Event raised in this method that the Form attaches to and calls
Form.Refresh(). This works fine when the ActiveIncrement is called in the
Form_Load event code but does not work when it is called in the
Threading.Timer code. Note: the this.Refresh() is called every time it just
has no visual effect when called in the Timer code.
What the hell is going on!!!??!!!!!?!?!?! Is there some sort of threading
issue that is preventing the form from invalidating? Does anyone have a
method for periodically updating the form display during start up code?
Cheers,
Peter Mauger