Solved

Clicking a Control in a Panel

Posted on 2003-10-27
5
145 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 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