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

ContextMenu + MouseMove issue

I call contextMenu.Show() in OnMouseDown handler the menu shows and then I
press mouse button in other area to hide the menu (without selecting an
option). Then I receive first OnMouseUp event, next OnMouseMove, which is
very unwanted behavior in my case -- I would prefer to first know that the
cursor has moved (and it has moved), only then the fact that a mouse button
was pressed. Is there a solution for this? Note: I have not added the
ContextMenu to a container or whatever.
Nov 16 '05 #1
2 2217
What excatly are you trying to do?...Maybe there is a better way to tackle
the task.

--
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
"lukasz" <bb****@op.pl> wrote in message
news:%2*******************@tk2msftngp13.phx.gbl...
I call contextMenu.Show() in OnMouseDown handler the menu shows and then I
press mouse button in other area to hide the menu (without selecting an
option). Then I receive first OnMouseUp event, next OnMouseMove, which is
very unwanted behavior in my case -- I would prefer to first know that the
cursor has moved (and it has moved), only then the fact that a mouse button was pressed. Is there a solution for this? Note: I have not added the
ContextMenu to a container or whatever.

Nov 16 '05 #2
I have a control that allows drawing and modifying shapes. I provide context
menu to access common tasks for a chosen shape. So I override OnMouseMove
for dragging shapes and OnMouseDown, OnMouseUp to set dragging flag if LMB
was pressed, or show the context menu if RMB was pressed. If the menu is
cancelled by a mouse click, the app gets nuts and moves shapes because:

1. it detects RMB down on the shape, so it selects current shape and popups
the menu for the shape
2. it detects LMB down in an away location -- since there was no mouse move
in the meantime, it assumes it is valid situation to enable moving the shape
3. now come the previous mouse move events (that should have occurred
between steps 1 & 2), and the shape is being moved (moving is in OnMouseMove
to allow interactive moving)
4. finally mouse up is fired (in the same position as mouse down since it
was merely a click) and the moving operation is finalized.

I either want step 3. to come after step 1., or an idea how to get around
this issue.
Nov 16 '05 #3

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

Similar topics

1
by: John Spiegel | last post by:
Hi All, Is it possible to build a ContextMenu object into a DLL then display that menu within a COM application? I'm having a problem with the ContextMenu expecting a Control object as a...
3
by: Crucifix | last post by:
Hello, I'm writing a small C# app, and part of what I'm trying to do involves the dragging of PictureBox controls on a form. Unfortunately, MouseMove seems to be behaving very oddly, causing...
0
by: Jorge | last post by:
Hello I am trying to browse a form and i know it has 3 contextmenus and a mainmenu. Public Sub PercorreMenus(ByVal f As Form) Dim ctl As Control For Each ctl In f.Controls If...
1
by: John Spiegel | last post by:
Hi All, Is it possible to build a ContextMenu object into a DLL then display that menu within a COM application? I'm having a problem with the ContextMenu expecting a Control object as a...
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?
0
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
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...

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.