Solved

How do you remove default events from a user control?

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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