Solved

Clicking a Control in a Panel

Posted on 2003-10-27
5
147 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
[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
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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…
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.
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 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…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 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