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

MouseLeave bug never to be fixed! >:(

Bob
I completely disagree with MS's decision to make you buy a whole new version
of their product to get a fix to such a basic, glaring, long-standing bug. I
deployed an entire ERP system written in DotNet in 2003, and having
MouseLeave stop firing makes all the mouse-tracking controls in its UI look
absolutely stupid, unprofessional. There is no workaround. Now they're
telling me they're never going to fix it, that I have to buy Whidbey. It's
not acceptable. Not at all.

http://lab.msdn.microsoft.com/produc...2-0ad03cc4add0

Bob
Nov 21 '05 #1
8 1999
"Bob" <no***@nowhere.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
I completely disagree with MS's decision to make you buy a whole new
version
of their product to get a fix to such a basic, glaring, long-standing bug.
I
deployed an entire ERP system written in DotNet in 2003, and having
MouseLeave stop firing makes all the mouse-tracking controls in its UI
look
absolutely stupid, unprofessional. There is no workaround. Now they're
telling me they're never going to fix it, that I have to buy Whidbey. It's
not acceptable. Not at all.

http://lab.msdn.microsoft.com/produc...2-0ad03cc4add0


I agree with you, for the most part. It seems that Beta class software is
all we have to work with these days. MS isn't the only one releasing this
stuff either.

fwiw, in "my" world, as a VB Classic developer, I'd always had to add
MouseEnter/Leave events on my own if I wanted them. So, while you're
probably right that there isn't a work around that'll get the built in
events firing, I find it hard to believe that there's no way to implement
your own. There are dozens of samples that show how to do it in VB Classic.
At least one of those should be able to make it through the "wizard" so you
can use it in B#.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 21 '05 #2
Bob
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...
I agree with you, for the most part. It seems that Beta class software is
all we have to work with these days. MS isn't the only one releasing this
stuff either.

fwiw, in "my" world, as a VB Classic developer, I'd always had to add
MouseEnter/Leave events on my own if I wanted them. So, while you're
probably right that there isn't a work around that'll get the built in
events firing, I find it hard to believe that there's no way to implement
your own. There are dozens of samples that show how to do it in VB Classic. At least one of those should be able to make it through the "wizard" so you can use it in B#.


All the workarounds I thought of were just too ugly to use, would you post a
link or two to any you'd recommend?

Bob
Nov 21 '05 #3
Bob wrote:
I completely disagree with MS's decision to make you buy a whole new version
of their product to get a fix to such a basic, glaring, long-standing bug. I
deployed an entire ERP system written in DotNet in 2003, and having
MouseLeave stop firing makes all the mouse-tracking controls in its UI look
absolutely stupid, unprofessional. There is no workaround. Now they're
telling me they're never going to fix it, that I have to buy Whidbey. It's
not acceptable. Not at all.

http://lab.msdn.microsoft.com/produc...2-0ad03cc4add0

Bob


As a workaround.. you could capture the mouse as the cursor enters it's
area.. then in the mousemove event check if the cursor moves outside the
boundaries and generate your own event or fire off a sub. If you code it
correctly, you just have to add one line per control you want to handle.
i.e.: addhandler txtText.MouseMove, AddressOff myMouseMove

Rinze van Huizen
Nov 21 '05 #4
Bob
"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl> wrote in message
news:8a********************@zeelandnet.nl...
Bob wrote:
As a workaround.. you could capture the mouse as the cursor enters it's
area.. then in the mousemove event check if the cursor moves outside the
boundaries and generate your own event or fire off a sub. If you code it
correctly, you just have to add one line per control you want to handle.
i.e.: addhandler txtText.MouseMove, AddressOff myMouseMove

Rinze van Huizen


MouseMove does not fire for a control when the mouse moves outside of its
boundaries. Perhaps I misunderstand your suggestion?

Bob
Nov 21 '05 #5
Bob wrote:
"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl> wrote in message
news:8a********************@zeelandnet.nl...
Bob wrote:
As a workaround.. you could capture the mouse as the cursor enters it's
area.. then in the mousemove event check if the cursor moves outside the
boundaries and generate your own event or fire off a sub. If you code it
correctly, you just have to add one line per control you want to handle.
i.e.: addhandler txtText.MouseMove, AddressOff myMouseMove

Rinze van Huizen

MouseMove does not fire for a control when the mouse moves outside of its
boundaries. Perhaps I misunderstand your suggestion?

Bob


In the handler you write you add something like
\\
Sub myMouseMove(sender as object, e as mouseeventargs)
if not sender.capture then
'capture the mouse if not already doing so
sender.capture=true
endif
if e.x>sender.width or e.x<0 or e.y>sender.height or e.y<0 then
' mouse has moved outside the boundaries of the control
'because of capture you can see the coordinates outside 'the control
sender.capture=false
myMouseLeave() 'fire off your own mouseleave event.
endif
end sub
//

not sure about mouseeventargs to be the correct name, but it's something
to that effect. I use this system for a simple report designer I
recently wrote for one of our applications.

Rinze van Huizen
Nov 21 '05 #6
Nak
Hi Bob,
I completely disagree with MS's decision to make you buy a whole new
version
of their product to get a fix to such a basic, glaring, long-standing bug.
I
deployed an entire ERP system written in DotNet in 2003, and having
MouseLeave stop firing makes all the mouse-tracking controls in its UI
look
absolutely stupid, unprofessional. There is no workaround. Now they're
telling me they're never going to fix it, that I have to buy Whidbey. It's
not acceptable. Not at all.


I have a solution! After a little messing around I remembered a problem
I had once, as it happens the Show and Hide methods don't work all that
well. Instead just use the Win32 API to show and hide the window!

Private Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Int32,
ByVal hWndInsertAfter As Int32, ByVal x As Int32, ByVal y As Int32, ByVal cx
As Int32, ByVal cy As Int32, ByVal wFlags As Int32) As Int32
Private Const SWP_SHOWWINDOW As Int32 = &H40
Private Const SWP_HIDEWINDOW As Int32 = &H80
Private Const SWP_NOMOVE As Int32 = &H2
Private Const SWP_NOSIZE As Int32 = &H1
'TO SHOW
Call SetWindowPos(frmForm2.Handle.ToInt32, 0, 0, 0, 0, 0, SWP_SHOWWINDOW Or
SWP_NOMOVE Or SWP_NOSIZE)

'TO HIDE
Call SetWindowPos(frmForm2.Handle.ToInt32, 0, 0, 0, 0, 0, SWP_HIDEWINDOW Or
SWP_NOMOVE Or SWP_NOSIZE)

I've tested this on the example of the bug from the MS web site and it
fixes the problem. I hope this helps!

Nick.
Nov 21 '05 #7
Bob
Simple and excellent. I owe you.

Thanks x 10^3,
Bob

"Nak" <a@a.com> wrote in message
news:eb**************@TK2MSFTNGP09.phx.gbl...
Hi again,

And here's an example for you that uses inheritance to create a derived Form that has a Show and Hide method that work correctly.

I hope this helps!

Nick.

Nov 21 '05 #8
Bob
"C-Services Holland b.v." <cs*@REMOVEcsh4u.nl> wrote in message
news:I6********************@zeelandnet.nl...
In the handler you write you add something like
\\
Sub myMouseMove(sender as object, e as mouseeventargs)
if not sender.capture then
'capture the mouse if not already doing so
sender.capture=true
endif
if e.x>sender.width or e.x<0 or e.y>sender.height or e.y<0 then
' mouse has moved outside the boundaries of the control
'because of capture you can see the coordinates outside 'the control
sender.capture=false
myMouseLeave() 'fire off your own mouseleave event.
endif
end sub
//


Interesting. I never used capture before.

For those NG readers who will inevitably search for and find this thread's
topic in the next months, here's how I made it work.

Thanks,
Bob

----------

Public Class HighlightPanel
Inherits Panel

Protected Overrides Sub OnMouseMove( _
ByVal e As System.Windows.Forms.MouseEventArgs)
If Not Me.Capture Then Me.Capture = True
Dim IsInControl As Boolean = Me.ClientRectangle.Contains(e.X, e.Y)
If IsInControl Then
If Not _MouseIsInControl Then Me.OnMouseEnter(e)
Else
If Me.Capture Then Me.Capture = False
If _MouseIsInControl Then Me.OnMouseLeave(e)
End If
MyBase.OnMouseMove(e)
End Sub

Private _MouseIsInControl As Boolean
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
_MouseIsInControl = True
Me.BackColor = Color.Red
MyBase.OnMouseEnter(e)
End Sub
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
_MouseIsInControl = False
Me.BackColor = SystemColors.Control
MyBase.OnMouseLeave(e)
End Sub

End Class
Nov 21 '05 #9

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

Similar topics

0
by: deus | last post by:
hi i write a user control that have inside pictureBox when the mouse leave the control AREA i want to do somthing the problem is that when i used mouseLeave event the event happaned also when the...
0
by: Machi | last post by:
I am using C#.NET. API version showintaskbar form Window taskbar hide show not fire events MouseLeave and MouseEnter! Now i am facing a critical problem for MouseLeave and MouseEnter event when i...
0
by: Johann Blake | last post by:
I created my own toolbar from scratch using PictureBoxes. I use the MouseEnter and MouseMove events to change the image on the PictureBox controls so that it makes the "button" look selected,...
0
by: A. Reza Bemanian | last post by:
Using both MouseHover and MouseLeave events for a group of buttons within a CLI WinForm application, the MouseLeave event misfires although the mouse cursor has not moved on the screen, and is set...
3
by: M O J O | last post by:
Hi, I have a panel on my form. I want to detect when the user enters my panel with his mouse and when he leaves my panel. If the user hovers a control inside my panel, I get the mouseleave,...
0
by: Pucara | last post by:
Hi all, I have noticed that the picturebox object doesnt' fire correctly the mouseEnter mouseLeave events. The problem is seen ONLY when you show a form more than once. You can reproduce it...
1
by: Michelangelo | last post by:
Hello, I have a form. On the form is a button. When I move the cursor onto the button, exactly on the edge (most outer pixel of the button), I get a continuous stream of MouseEnter and...
1
by: Huahe | last post by:
Hi, I have an checkedlistbox with a lot of items, so there is a vertical scrollbar in the checkedlistbox. I want to make the checkedlistbox invisible when the mouseleave event goes off. The...
4
by: spacemanafrica | last post by:
Hello all! I'm working on a C# app that changes the background color of the form on mouseenter then changes it back to the original on mouseleave. For the most part this has been working pretty...
3
by: rory.groves | last post by:
I have an C# .NET 2.0 application which runs fine on XP, but on Vista (Home Basic), the MouseUp event does not fire until i move the mouse over another control/button in the application. The same...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.