Solved

Clicking a Control in a Panel

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 95
Help me. 3 79
Automatically generate a pdf file from an excel file and email out everyday 2 78
VBA: Insert New column with specific format type 12 57
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 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