Solved

Create a click event for a custom user control

Posted on 2007-03-27
2
188 Views
Last Modified: 2013-11-07
I have created a custom user control, which consists of a panel and labels on the panel displaying different information that is returned from a query.  I programmatically add this new control to a windows form.  I add one new control for each record that is returned.  I want the user to be able to click anywhere on my new control and have the click event triggered.

I am not sure how to handle this.
I am using vb.net visual studio 2005

Thanks for the help.
0
Comment
Question by:EXTRHMAN
[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 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18803814
You need to declare your own custom click event to raise from your usercontrol.

Then in the click event of every panel/label you raise your custom event.

Trap the custom event in the main form...
0
 
LVL 1

Author Comment

by:EXTRHMAN
ID: 18808146
Thanks Idle_Mind.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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