PC Review


Reply
Thread Tools Rate Thread

DragDrop vs. Click events

 
 
HaySeed
Guest
Posts: n/a
 
      12th Nov 2008
Captutring a mouseDown event and instituting a "DragDrop" operation seems to
keep the Click event from firing.

void ColumnHeader_MouseDown(object sender, MouseEventArgs e) {
if (e.Button == MouseButtons.Left) {
this.DoDragDrop(this, DragDropEffects.Copy);
}
}

Is there a way to have both? When a user presses the mouse down on a
Control and drags - it should invoke a DragDrop operation, when they Click
the header it should invoke a Click.

Any suggestions?

 
Reply With Quote
 
 
 
 
Jack Jackson
Guest
Posts: n/a
 
      13th Nov 2008
On Wed, 12 Nov 2008 14:10:23 -0800, HaySeed
<(E-Mail Removed)> wrote:

>Captutring a mouseDown event and instituting a "DragDrop" operation seems to
>keep the Click event from firing.
>
> void ColumnHeader_MouseDown(object sender, MouseEventArgs e) {
> if (e.Button == MouseButtons.Left) {
> this.DoDragDrop(this, DragDropEffects.Copy);
> }
> }
>
>Is there a way to have both? When a user presses the mouse down on a
>Control and drags - it should invoke a DragDrop operation, when they Click
>the header it should invoke a Click.
>
>Any suggestions?


Since you have to click before you can drag, I assume you mean if you
press the mouse button and let it up without moving the mouse you want
click processing, and if the mouse moves you want to start a drag.

You could start the drag when the mouse moves while the button is
pressed. It might be necessary to allow a little bit of movement
without starting a drag. You also might want to do the click
processing on MouseUp instead of click, depending on whether or not
you want the click processing to occur when the user does a drag.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard and Mouse Events - During DragDrop - Need help =?Utf-8?B?R2FtZXk=?= Microsoft Dot NET 0 21st Aug 2006 04:02 AM
DragDrop, Click and DoubleClick on a PictureBox Jesse Microsoft Dot NET Framework Forms 0 26th Nov 2005 07:51 AM
implementing dragdrop whilst allowing click David J Rose Microsoft C# .NET 6 20th Jun 2005 11:52 PM
implementing dragdrop whilst allowing click David J Rose Microsoft Dot NET Framework Forms 1 11th May 2005 05:05 PM
PictureBox DragDrop and Click coexist whon Microsoft VB .NET 1 3rd Mar 2004 01:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:05 PM.