What is the "Right-Click Drag" Event in the ListView control called?

T

Tom P.

I am writting a extended ListView control and I'd like to stop the
default behavior when a user right-clciks on a non-label area and then
drags causing a "marching ants" selection box to appear. First, what
event is this? And second, how do I stop it?

I've trapped the OnItemDrag and OnDragEnter events and it's not them
(OnDragEnter doesn't even fire).

In OnClick I test for right-click and simply return.

Where is this stuff?

Tom P.
 
N

Nicholas Paldino [.NET/C# MVP]

Tom,

You are probably going to have to drop down to the WndProc method
(override it, that is) and handle the windows messages that signal the
beginning of the right click (WM_RBUTTONDOWN) as well as the subsequent
messages (WM_RBUTTONUP).
 
T

Tom P.

That allows me to trap the series of events that cause the behavior
but I still can't stop it.

I'm trying to stop the drawing of the rubberband selection marquee.
And now that I look it's happening during left-clicks as well. My
inherited ListView is set to OwnerDraw = true but nothing I can do
will turn the selection marquee off.

Tom P.


Tom,

    You are probably going to have to drop down to the WndProc method
(override it, that is) and handle the windows messages that signal the
beginning of the right click (WM_RBUTTONDOWN) as well as the subsequent
messages (WM_RBUTTONUP).

--
 - Nicholas Paldino [.NET/C# MVP]
 - (e-mail address removed)


I am writting a extended ListView control and I'd like to stop the
default behavior when a user right-clciks on a non-label area and then
drags causing a "marching ants" selection box to appear. First, what
event is this? And second, how do I stop it?
I've trapped the OnItemDrag and OnDragEnter events and it's not them
(OnDragEnter doesn't even fire).
In OnClick I test for right-click and simply return.
Where is this stuff?
 

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