?
Solved

How do you remove default events from a user control?

Posted on 2009-04-02
2
Medium Priority
?
160 Views
Last Modified: 2012-05-06
I'm attempting to create a user control with a series of events.  However, by default, there are already 2^256 default events on the user control.  I want to remove ALL of these events, so the user control ONLY has the events *I* want available.  How is this doable?
0
Comment
Question by:Javin007
2 Comments
 
LVL 12

Accepted Solution

by:
omegaomega earned 2000 total points
ID: 24052023
Hello, Javin007,

You could Shadow the events with events of the same name that are never triggered.  In order to "hide" these ineffective events on the forms where the UserControl is located, just mark them as "obsolete".  For example:

    <Obsolete()> _
    Public Shadows Event Click()

But if there are a lot of events that you want to hide, you might be better off to create your own control directly.  (I.e. inherit from Control instead of UserControl).  To decide which is better, you must think about what functionality UserControl is giving you that will be hard to implement in your own control.

Cheers,
Randy
0
 
LVL 4

Author Closing Comment

by:Javin007
ID: 31565834
Thanks!  Exactly what I needed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

807 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