Regaining Focus

G

Guest

I'm working in Visual Studio 2005, with C# and C++ code.

My user opens a C# WinForm, and presses a button which fires an event. The
event subscriber catches the event, and draws a dot on a map. The event code
completes and it all seems to work great.

The problem is that after the draw-dot routine completes, both the main
program and C# winform stop responding to mouse clicks. If I click on Visual
Studio itself, then the application starts responding normally again.

Here's the odd part: if I put a MessageBox.Show("Hello World"); right after
the code that fires the event, I see the message box right after the dot
appears. I click ok in the message box, and everything works normally after
that.

I tried replacing MessageBox.Show() with just a this.Refresh(), but it has
no effect and I'm left with no response to the mouse clicks.

It seems something is getting locked and not releasing until either the
click on Visual Studio or the click on the MessageBox.Show(). Any ideas on
what the MessageBox.Show() might be releasing?

Thanks
 
G

Guest

Opps. I forgot the following after completing the event to draw the dot:

pMyView->EnableWindow(false);
pMain->ShowWindow(SW_SHOW);
pMain->EnableWindow();

Works like a charm now. Sorry about the wasted bandwidth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top