473,809 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mouse events

I'm trying to use the MouseEnter event but it isn't behaving how I'd like it
to. The problem is that if you hold down the mouse button over another
control (or the form) and then enter the control, the event isn't triggered.

Is there any way to make the MouseEnter event occur in this situation?
Nov 17 '05 #1
5 6364
"Barguast" <It************ *****@Email.com > wrote in message
news:83******** *************** ***********@mic rosoft.com...
I'm trying to use the MouseEnter event but it isn't behaving how I'd like
it
to. The problem is that if you hold down the mouse button over another
control (or the form) and then enter the control, the event isn't
triggered.
When you hold down the mouse on a control/window that window "captures" the
mouse to ensure that it will receive the MouseUp event from Windows. This
means that the mouse is not available to the other controls.
Is there any way to make the MouseEnter event occur in this situation?


Probably, but it'd likely involve some pretty nasty Win32 code. Are you sure
that this is so important?
Nov 17 '05 #2
The event that will be triggered is Dragging because the button is pressed.

cheers
Salva

"Barguast" wrote:
I'm trying to use the MouseEnter event but it isn't behaving how I'd like it
to. The problem is that if you hold down the mouse button over another
control (or the form) and then enter the control, the event isn't triggered.

Is there any way to make the MouseEnter event occur in this situation?

Nov 17 '05 #3
> Probably, but it'd likely involve some pretty nasty Win32 code. Are you sure
that this is so important?


It is pretty important. I've made a 'table' control that itself contains a
number of 'cell' controls. I'm trying to enable the ability to select a block
of cells like you would in a spreadsheet (hold the mouse button down over one
cell, release it over another cell, and select all the cells inbetween). I
was hoping to use the MouseEnter event of a cell to detect when the block
selection had changed but, as I said, the event won't trigger when the mouse
button is pressed down :(
Nov 17 '05 #4
None of the Drag events are triggering either. But then again, I wouldn't
have thought the Dragging events were supposed to trigger in this specific
situation...

"Salvador" wrote:
The event that will be triggered is Dragging because the button is pressed.

cheers
Salva

"Barguast" wrote:
I'm trying to use the MouseEnter event but it isn't behaving how I'd like it
to. The problem is that if you hold down the mouse button over another
control (or the form) and then enter the control, the event isn't triggered.

Is there any way to make the MouseEnter event occur in this situation?

Nov 17 '05 #5
"Barguast" <It************ *****@Email.com > wrote in message
news:5A******** *************** ***********@mic rosoft.com...
Probably, but it'd likely involve some pretty nasty Win32 code. Are you
sure
that this is so important?


It is pretty important. I've made a 'table' control that itself contains a
number of 'cell' controls. I'm trying to enable the ability to select a
block
of cells like you would in a spreadsheet (hold the mouse button down over
one
cell, release it over another cell, and select all the cells inbetween). I
was hoping to use the MouseEnter event of a cell to detect when the block
selection had changed but, as I said, the event won't trigger when the
mouse
button is pressed down :(


An easier option would be to have the table draw the cells, rather than have
them as separate controls.

Anyway, if you decide you have to follow your current route, I can't help
you much more than indicate the direction of your research:
- Have a look at ReleaseCapture and SetCapture. Calling ReleaseCapture when
the mouse exits the cell will allow other cells to received it's events.
However it'll stop the original control receiving the MouseUp event. You can
probably pass this message on to the original window.
- Have a look at the WM_LBUTTONUP message.

What I *think* you might have to do is track that a MouseDown occurs, then
call ReleaseCapture on the starting control. Then, once the button is
actually released, pass the WM_LBUTTONUP message to the original control.
Note that it might be possible to do without this step. However, if not, you
might need to trap the WM_LBUTTONUP messages, since the .NET control your
mouse is over might not pass them through if they're not matched with a
corresponding WM_LBUTTONDOWN message.
Nov 17 '05 #6

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

Similar topics

5
6230
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 buttons, which is fine most of the time (he comes from a Mac environment, so I accept mouse clicks from the right or left button when he's working on the PC). But every once in a while, he'll press and hold the right mouse button, move onto a JButton,...
0
2698
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 selected its position was adjusted in accordance with the mouse move events. After migrating it to VB.NET I tried setting the PictureBox class's BorderStyle to Fixed3D or FixedSingle during the Mouse Down event. However, doing so seems to prevent...
1
9780
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 events respond continuously whenever the mouse is moving inside the DIV area. Does anybody have a clue about what is happenning ? J2G
3
10685
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 userControl, I can detect the movement using MouseMove event. the problem is when the mouse is on the child control : I can t detect
5
3768
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 processing on certain key/mouse events 3) If key/mouse events interrupt processing, the events should not be discarded since they need to be handled but AFTER the current processing is complete
3
4491
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. Whenever I hook any of the HTMLDocumnetEvent2_Event events like this: HTMLDocumentEvents2_Event DocEvents = this.Browser.Document as HTMLDocumentEvents2_Event ; DocEvents.oncontextmenu += new...
3
3122
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 that they can change the cursor. However, my control has several standard controls on it, and the consumer of my control only gets MouseMove events when the mouse is over the control itself, and not when it is over the standard controls....
2
15463
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 events allowing the user control to react to the mouse click. Setting the Enabled property on the label to False comes close, but I don't want the font color to change. Does anyone have an idea how .NET implements the code behind the Enabled...
5
574
by: Adeel | last post by:
Hi group! I'm trying to learn C# on my own... I'd appreciate it very much if someone can help me out here. I have a basic form without any controls on it... I want to catch mouse clicks (both left and right). When I select the form and go to the events tab (the bolt icon in properties), it gives me several options to choose from...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9199
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.