Form.Refresh during intensive processing

Tech-Archive recommends: Speed Up your PC by fixing your registry



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
.



Relevant Pages

  • Re: Success: Mirroring X display on ibook G4 12" 1066MHz
    ... >I finally managed to get my iBook to display the same content on its ... LoadModule: "pcidata" ... Loading /usr/X11R6/lib/modules/libpcidata.a ... Initializing built-in extension XInputExtension ...
    (comp.os.linux.powerpc)
  • Re: Next Version of GDI+ (maybe GDI+ 2.0)
    ... loading and manipulating of such files isn't lightning fast unless you have really powerfull dedicated hardware. ... to see whole image you need to read whole image, and then eventualy generate a smaller sample for display. ... BUT to have this smaler sample you need to load ALL the pixels of oryginal image. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Next Version of GDI+ (maybe GDI+ 2.0)
    ... Alejandro Lapeyre ... > loading and manipulating of such files isn't lightning fast unless you ... > smaller sample for display. ... > load ALL the pixels of oryginal image. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: unreliable IE IMG object ... the lamentation continues ...
    ... >i.e., to display one picture in the IMG object at one time, ... >and another picture at another time, ... the time the src property is set and the image is completely loaded. ... There's certainly no point loading "pictureLoading.jpg" twice. ...
    (microsoft.public.scripting.jscript)
  • Using Multi-threading
    ... I am designing an interface which allows users to load certain files ... I want to display a ... want the form to be displayed during the loading process and the ...
    (microsoft.public.dotnet.languages.vb)