Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do you remove default events from a user control?

Posted on 2009-04-02
2
Medium Priority
?
157 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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

618 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