473,385 Members | 1,356 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,385 software developers and data experts.

Mouse Events in an mdi Project

In a simple two form project, use a button on each form to Show() the other
form and Hide() the current form. Add MouseEnter and MouseLeave events to
both buttons so they change the image on each button when they are NOT
Clicked but the cursor enters their boundary.

This setup works fine. If the mouse cursor enters the button on the first
form the image changes and if the button is clicked the first form
disappears and the other form duly appears. When the mouse cursor enters the
second form button the image changes and if the second form button is
clicked the second form disappears and the first form reappears with a
button showing the "Normal" (As Opposed to "Hover" Image). Repeat and
everything works fine. Now if you spread the images apart you see that they
are both present all the time, it is the focus that is really changing.

This can be repeated with Visible = True or False instead of Show() and
Hide()

Now create a new project. Repeat the above but where a third form, the first
one created is an mdi Parent and the two forms Form2 and Form3 are children.

Now the button image works fine until you click it. Now the second form
(Form3) appears and it's button works fine until you click it. Upon
returning to the first form (Form2) the image is locked at the hover image
and does not change. Returning to the second form (Form3) you will find it's
button's image is also locked.

Note that in this instance the forms do actually disappear from view.

Why does this happen and how do you cure it?

If you have forms with several hover buttons present the effects can be
random and have an effect on some or ALL buttons even when they were not
used.

Event handlers do not seem to work unless I've developed a blind spot from
staring at the problem for too long. Also the useful advice from the MS Help
page : "Handling User Input"

Under : Mouse events

Event Name : Mouse Enter

Method to Override : void OnMouseEnter (EventArgs)

Or

Event Name : Mouse Leave

Method to Override : void OnMouseLeave (EventArgs)

Seems less than helpful

Any cures anyone ?
Nov 21 '05 #1
0 1433

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

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
0
by: Stephen Williams | last post by:
I am migrating a VB 6 PictureBox control to VB.NET. In VB 6, this control modified its border style during the mouse down and up events to provide user feedback that it was selected. Once...
1
by: Jean-Gael GRICOURT | last post by:
I am trying to capture mouse events when entering and leaving a DIV layer. This test code works fine with IE 6.0 and Opera 7.21 but fails with Mozilla/Netscape. The strange thing is that the mouse...
3
by: red | last post by:
mouse events when the mouse is on a "child control" hi everyone; my problem: I have a userControl in this usercontrol, I have a child control (a button) when the mouse moves over the...
5
by: Bill Henning | last post by:
Does anyone know a good method of preventing keyboard and mouse events from interrupting processing? My situation is: 1) I need to track and handle all key and mouse events 2) I need to perform...
3
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events....
3
by: Charles Law | last post by:
In a user control, is it possible to replace the default mouse events with my own? In particular, I want the consumer of my control to get MouseMove events when the mouse is over my control, so...
2
by: bretth | last post by:
In a VB.Net Windows Forms application, I have a user control that handles mouse events. Another section of code programmatically adds a label to the control. I would like label to ignore all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.