Solved

Clicking a Control in a Panel

Posted on 2003-10-27
5
141 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
Comment Utility
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
Comment Utility
Do you mind posting a followup?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

772 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

8 Experts available now in Live!

Get 1:1 Help Now