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 / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

Forcing a MouseUp event after MouseDown launches a dialog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
charlieopenshaw@gmail.com - 09 Jul 2007 08:56 GMT
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.
Peter Duniho - 09 Jul 2007 18:08 GMT
> I have a form listview and have used the MouseDown event to launch a
> modal dialog if a particular cell is clicked.
[quoted text clipped - 5 lines]
> 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
charlieopenshaw@gmail.com - 09 Jul 2007 22:12 GMT
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.
[quoted text clipped - 14 lines]
>
> Pete

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.