Re: ShowDialog and asynchronous code execution
From: Dennis Sjogren (lakebranch_at_REMOVE_THIS.gmail.com)
Date: 10/13/04
- Next message: Carlos J. Quintero [MVP]: "Re: Whoopsies..."
- Previous message: Nak: "Re: ListView Control"
- In reply to: Cor Ligthert: "Re: ShowDialog and asynchronous code execution"
- Next in thread: Ken Tucker [MVP]: "Re: ShowDialog and asynchronous code execution"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 13 Oct 2004 13:02:15 +0200
Cor,
> I made this sample a week ago, look through it, it uses two methods to show
> to seperated splash screens.
Looking at your code inspired me to try the multithreaded approach
again. After much gnashing of teeth, I finally have a working solution.
It uses a wrapper class that manages my status windows. It has a Show()
method that creates a new status form in it's own thread. The wrapper
also has a Hide() method which uses Invoke (which should be safe in a
threaded environment) to call the Close method of the status form in
question.
I've used Thread.Name and Debug to verify that no method calls are
beging done over thread boundaries.
This is how I use it:
Private BusyWindow as New frmBusyWindow(Me)
BusyWindow.Show("Searching...")
.
. <CODE>
.
BusyWindow.Hide()
Note: frmBusyWindow.Show(Text as String) returns immediately after
starting the new thread, which makes the status window appear at the
same time as the code following the Show call executes.
Thanks for inspiring me!
Regards,
/dempa
- Next message: Carlos J. Quintero [MVP]: "Re: Whoopsies..."
- Previous message: Nak: "Re: ListView Control"
- In reply to: Cor Ligthert: "Re: ShowDialog and asynchronous code execution"
- Next in thread: Ken Tucker [MVP]: "Re: ShowDialog and asynchronous code execution"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|