Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

ControlDesigner OnMouseDragMove only called once?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Seth - 16 Jan 2007 18:44 GMT
I am playing with overriding the ControlDesigner OnMouseDragMove.  But for
some reason it only appears to get called when a control just begins its
drag.  I was anticipating it to be called for every movement of the mouse
during the drag.  Am I missing something so that this method is only called
once?  Is there another method I should be using that will be called for
each movement of the mouse?
Bryan Phillips - 17 Jan 2007 01:31 GMT
That is the correct method.  Can you post some sample code?

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> I am playing with overriding the ControlDesigner OnMouseDragMove.  But for
> some reason it only appears to get called when a control just begins its
> drag.  I was anticipating it to be called for every movement of the mouse
> during the drag.  Am I missing something so that this method is only called
> once?  Is there another method I should be using that will be called for
> each movement of the mouse?
Seth - 17 Jan 2007 02:07 GMT
Nothing too exciting:

[System.Security.Permissions.PermissionSet(
System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust" )]
public class PadDesigner : System.Windows.Forms.Design.ControlDesigner
{
protected override void OnMouseDragMove( int x, int y )
{
 System.Diagnostics.Trace.WriteLine( string.Format( "{0}, {1}", x, y ) );
 base.OnMouseDragMove( x, y );
}
}

> That is the correct method.  Can you post some sample code?
>
[quoted text clipped - 11 lines]
>> once?  Is there another method I should be using that will be called for
>> each movement of the mouse?
Bryan Phillips - 17 Jan 2007 03:12 GMT
It happens the same way for me.  I drag and it is called 3 or 4 times
and quits.  I overrode the WndProc and checked for the WM_MOUSEMOVE and
WM_NCMOUSEMOVE messages and they seem to stop too.  It looks like the
Windows message just stop.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> Nothing too exciting:
>
[quoted text clipped - 24 lines]
> >> once?  Is there another method I should be using that will be called for
> >> each movement of the mouse?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.