Solved

How do you remove default events from a user control?

Posted on 2009-04-02
2
148 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio editor? 1 38
DataGridView Events ? 3 37
scanning dentists xray (the small ones) 3 44
Close tabpage of custom control 9 23
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

920 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

11 Experts available now in Live!

Get 1:1 Help Now