Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detect if mouse button was released

Posted on 1999-07-14
6
Medium Priority
?
170 Views
Last Modified: 2010-05-02
Hi,

Who can tell me, how I can react on when the user releases the left mouse button. My Problem is the following:
I want to implement a function where the user can draw a free rectangle. The drawing should begin by pressing the mouse button and should be finished by releasing. With the mousemove the rectangle should resize. I know that I can use the mousemove event of a container, but I can't handle it if the user releases over another control. And what event occurs if the user does not move the mouse anymore and releases the button then?

Please help me
0
Comment
Question by:cas1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Author Comment

by:cas1
ID: 1524609
Edited text of question.
0
 
LVL 2

Accepted Solution

by:
s_lavie earned 150 total points
ID: 1524610
Use a PictureBox as the control for drawing the rectangle.
MouseUp is the event thay response to user releases the mouse button...
0
 
LVL 4

Expert Comment

by:Jeremy_D
ID: 1524611
The control receiving the MouseUp event is the same as the control that received the initial MouseDown event, so if the user presses the mouse-button on the Form and releases it over, say, a command-button, it's still the Form that receives the MouseUp event. So the event you'll probably need is the "Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)"-event (this also works for other containers like a PictureBox).
    The MouseUp- and MouseDown-events get a Button parameter which is 1 if the user pressed (or released) the left mouse-button.

Hope this helps,
Jeremy

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Author Comment

by:cas1
ID: 1524612
Oh, my dear! I grasped that there is a mouse up event at nearly each control. Shame over me, but I'm a bloody beginner. Thanx to jeremy, too
0
 
LVL 4

Expert Comment

by:Jeremy_D
ID: 1524613
Damn (pardon my french) s_lavie. if IE5 didn't hang so much I would have been 6 minutes before you!  ;-)
Jeremy

0
 
LVL 4

Author Comment

by:cas1
ID: 1524614
Sorry. Jeremy but maybe the next question is as easy as the last one
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question