Carl
Mon Mar 03 05:30:38 CST 2008
I'm calling myForm.ShowDialog (instead of Application.Run) which I think
also creates a message queue. I want to call it because I need to set
myForm.TopMost and/or BringToFront toghether with DoEvents, in each loop, to
make sure that the form always (or as much as possible at least) is visible
on top.
regards
Carl
"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.2235e92ba0c8d9aa23@msnews.microsoft.com...
> Carl <ask@4it.com> wrote:
>> I have a thread (not the main) in my app that draws GUI. It's a
>> STA-thread,
>> and it seems OK. Though I would like to process its message queue, like
>>
>> Application.DoEvents (for the main thread). It should have a message
>> queue
>> since it draws GUI.
>
> It will have a message queue if you've made it have one. Are you
> calling Application.Run on that thread?
>
>> How do I "do a DoEvents" for a specific thread?
>
> Well, it would be best to avoid requiring DoEvents in the first place.
> Why do you want to call it?
>
> I believe if you call Application.DoEvents() on the other thread,
> however, it will process that thread's message queue.
>
> --
> Jon Skeet - <skeet@pobox.com>
>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
> World class .NET training in the UK:
http://iterativetraining.co.uk