Forcing a MouseUp event after MouseDown launches a dialog

  • Thread starter charlieopenshaw
  • Start date
C

charlieopenshaw

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.
 
P

Peter Duniho

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
 
C

charlieopenshaw

Peter,

Thanks - worked a treat.

Charlie

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top