473,399 Members | 2,146 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,399 software developers and data experts.

Forcing a MouseUp event after MouseDown launches a dialog

I have a form listview and have used the MouseDown event to launch a
modal dialog if a particular cell is clicked.

This works fine but upon closing the dialog I am left with a dotted
rectangle drawn between where the original click was and where I
clicked to close the dialog. Until another mouse click occurs this
rectangle resizes as you move the mouse. I guess this is because the
MouseUp event hasn't fired yet (or fired on the modal dialog).

What is the best way to prevent this, or invoke the MouseUp event once
the dialog has closed.

Jul 9 '07 #1
2 3132
On Mon, 09 Jul 2007 00:56:48 -0700, <ch*************@gmail.comwrote:
I have a form listview and have used the MouseDown event to launch a
modal dialog if a particular cell is clicked.

This works fine but upon closing the dialog I am left with a dotted
rectangle drawn between where the original click was and where I
clicked to close the dialog. [...]

What is the best way to prevent this, or invoke the MouseUp event once
the dialog has closed.
The answer is to not invoke the dialog on the MouseDown event. Doing so
is non-standard UI anyway, and creates the situation you're seeing in
which the same user action that would normally be interpreted as
mouse-dragging is being overloaded with the dialog invocation as well.

Instead, use MouseUp for knowing when to show the dialog.

Pete
Jul 9 '07 #2
Peter,

Thanks - worked a treat.

Charlie

On 9 Jul, 18:08, "Peter Duniho" <NpOeStPe...@nnowslpianmk.comwrote:
On Mon, 09 Jul 2007 00:56:48 -0700, <charlieopens...@gmail.comwrote:
I have a form listview and have used the MouseDown event to launch a
modal dialog if a particular cell is clicked.
This works fine but upon closing the dialog I am left with a dotted
rectangle drawn between where the original click was and where I
clicked to close the dialog. [...]
What is the best way to prevent this, or invoke theMouseUpevent once
the dialog has closed.

The answer is to not invoke the dialog on the MouseDown event. Doing so
is non-standard UI anyway, and creates the situation you're seeing in
which the same user action that would normally be interpreted as
mouse-dragging is being overloaded with the dialog invocation as well.

Instead, useMouseUpfor knowing when to show the dialog.

Pete

Jul 9 '07 #3

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

Similar topics

1
by: Jeremy Robertson | last post by:
I'm working on an application that manages large image files (mulit-page ..Tiff's to be exact some 1000+ pages). I've written an user control that displays a number of the images as thumbnails...
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
4
by: Michael Maes | last post by:
Hi, I have a child-form in an MDI-Application which seems to loose the MouseUp-Event. I grid (for navigation-purpose) appears on many of the child-forms and in (I think) only one this issue...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
2
by: dave.wayne | last post by:
In a web page I have a div tag that has a onlick event registered through the event listener. However, that same div tag also has a onmousedown - start a drag and drop script The problem I am...
3
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the...
1
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...

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.