473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Regaining Focus

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
--
Randy
Jan 17 '07 #1
1 1743
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.
--
Randy
"randy1200" wrote:
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
--
Randy
Jan 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nitin | last post by:
Hi I have created function to check date and time. at the time of execution, if date is left empty the function returns the error message but then the focus goes to next field. Next filed is for...
3
by: VanIkyn | last post by:
Hello peoples, This is a last resort, as I've run out of search strings I can think of for this problem. There may very well be a simple and logical solution that I have overlooked. Thanks in...
17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
1
by: avnrao | last post by:
Hi, I am facing a problem with control.focus (javascript). Here is the description of the issue. 1. I have 2 aspx files. on Aspx1 I have button named NewRow. Clicking on this, will redirect...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
7
by: Dave Booker | last post by:
I am using a WebBrowser object in my .NET 2.0 application, but it is not shown to the user. Every time a timer event triggers it to perform a m_WebBrowser.Navigate() I get that classic IE 'click'...
7
by: marty.overdear | last post by:
I am opening a new window using window.open. I need the new window to open on top of the parent everytime. I cannot use onBlur b/c the user will need to click back to the parent for information. ...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.