Click here to Skip to main content
15,921,622 members
Home / Discussions / C#
   

C#

 
GeneralSplitContainer hiding panel Pin
s196675m28-Dec-07 10:39
s196675m28-Dec-07 10:39 
GeneralRe: SplitContainer hiding panel Pin
GuyThiebaut28-Dec-07 10:41
professionalGuyThiebaut28-Dec-07 10:41 
GeneralRichTextBox formatting Pin
GuyThiebaut28-Dec-07 10:13
professionalGuyThiebaut28-Dec-07 10:13 
GeneralRe: RichTextBox formatting Pin
Het210928-Dec-07 10:50
Het210928-Dec-07 10:50 
GeneralRe: RichTextBox formatting Pin
GuyThiebaut28-Dec-07 11:06
professionalGuyThiebaut28-Dec-07 11:06 
GeneralRe: RichTextBox formatting Pin
KaptinKrunch28-Dec-07 10:58
KaptinKrunch28-Dec-07 10:58 
GeneralRe: RichTextBox formatting Pin
GuyThiebaut28-Dec-07 11:09
professionalGuyThiebaut28-Dec-07 11:09 
QuestionHow can I flush events in .Net? Pin
JoeRip28-Dec-07 10:03
JoeRip28-Dec-07 10:03 
I'm looking for something like the old Windows API FlushEvents().

I have a form which creates a COM object like such:

COMServerObject foo = new COMServerObject;

While my code waits for this singular statement to return, Windows makes my form window modal. If it takes a while for this statement to return - up to 20 seconds for .NET to give up and throw an exception - Windows queues up mouse clicks and keyboard events on my form, and then plays them back once the statement returns.

This is nasty, as the user hammers away at my unresponsive window, even trying to close it. So once the statement returns, my window can suddenly fly around the screen, resize, minimize, and even close.

I've tried disabling the Form while while I wait:

...<br />
this.Enabled = false;<br />
COMServerObject foo = new COMServerObject;<br />
this.Enabled = true;<br />
...


And this prevents clicks on my various buttons and menus. However, it does NOT prevent clicks on the window frame or title bar or close controls, so they still get queued up.

How can I prevent these from queuing? In the old Windows API, you could call FlushEvents when you got back from a modal state, which would remove all Windows events from it's message queue. I can't find anything analogous in the .Net framework. Anybody know the proper technique, here?
AnswerRe: How can I flush events in .Net? Pin
Not Active28-Dec-07 10:44
mentorNot Active28-Dec-07 10:44 
GeneralRe: How can I flush events in .Net? Pin
JoeRip28-Dec-07 14:43
JoeRip28-Dec-07 14:43 
GeneralRe: How can I flush events in .Net? Pin
Luc Pattyn29-Dec-07 2:15
sitebuilderLuc Pattyn29-Dec-07 2:15 
GeneralRe: How can I flush events in .Net? Pin
JoeRip29-Dec-07 2:26
JoeRip29-Dec-07 2:26 
GeneralRe: How can I flush events in .Net? Pin
Luc Pattyn29-Dec-07 2:47
sitebuilderLuc Pattyn29-Dec-07 2:47 
GeneralRe: How can I flush events in .Net? Pin
JoeRip29-Dec-07 2:54
JoeRip29-Dec-07 2:54 
GeneralRe: How can I flush events in .Net? Pin
Mark Churchill30-Dec-07 16:08
Mark Churchill30-Dec-07 16:08 
GeneralRe: How can I flush events in .Net? Pin
JoeRip30-Dec-07 19:41
JoeRip30-Dec-07 19:41 
QuestionAny query???? Pin
omegazafer28-Dec-07 10:02
omegazafer28-Dec-07 10:02 
AnswerRe: Any query???? [modified] Pin
GuyThiebaut28-Dec-07 10:20
professionalGuyThiebaut28-Dec-07 10:20 
GeneralRe: Any query???? Pin
omegazafer28-Dec-07 11:10
omegazafer28-Dec-07 11:10 
GeneralRe: Any query???? Pin
GuyThiebaut28-Dec-07 11:18
professionalGuyThiebaut28-Dec-07 11:18 
GeneralRe: Any query???? Pin
omegazafer28-Dec-07 11:32
omegazafer28-Dec-07 11:32 
GeneralAccessing folder from outlook express 2003 with C# 1.1 Pin
Het210928-Dec-07 8:19
Het210928-Dec-07 8:19 
GeneralRe: Accessing folder from outlook express 2003 with C# 1.1 Pin
KaptinKrunch28-Dec-07 8:59
KaptinKrunch28-Dec-07 8:59 
GeneralRe: Accessing folder from outlook express 2003 with C# 1.1 Pin
Het210928-Dec-07 9:05
Het210928-Dec-07 9:05 
GeneralRe: Accessing folder from outlook express 2003 with C# 1.1 Pin
KaptinKrunch28-Dec-07 9:15
KaptinKrunch28-Dec-07 9:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.