Solved

How do you remove default events from a user control?

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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.
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…

705 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

19 Experts available now in Live!

Get 1:1 Help Now