Solved

Clicking a Control in a Panel

Posted on 2003-10-27
5
142 Views
Last Modified: 2010-05-03
I'm capturing the X and Y positions of the mouse click in a Panel, and it works fine unless I click on a control inside that panel.  What I want is to know the location of the clicking inside the panel even if I clicked on a control (the control is a custom one, if this adds anything).

Using VB.NET
0
Comment
Question by:wireframe9
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
ashoooo earned 250 total points
ID: 9634541
Assuming there is a control ctl1 inside the Panel pan1
In the design mode of the control, double click the control ctl1


Event MouseDown(...)
...
Private Sub ct1_MouseDown(..., Byval X as Integer, ByVal Y as Integer)

   RaiseEvent MouseDown(..., X + ctl1.Left, Y + ctl1.Top) ' add the left and top of the control to give X and Y relative to the control.

End Sub
0
 
LVL 3

Expert Comment

by:ashoooo
ID: 9839732
Do you mind posting a followup?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Write data from SQL to CSV file - position 1 53
Visual Basic Excel Formatting error 4 85
JSON Response and request in VB6 application 11 252
Adding to a VBA? 6 63
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now