Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
i have a class that is inherited from TreeView. I want to "Hide" some of the Events that are inherited. for example I don't want the "AfterCheck" Event to be "Fired". With the Properties I've Used "<Browsable(False), EditorBrowsable(EditorBrowsableState.Never),Bindable(False)>" but that doesn't work for Events. Any Ideas? I can't seem to find anything on this topic anywhere.
Posted
You can override an overridable parent event and not call the parent implementation, but I don't think you can prevent an inherited event from firing.
Posted
I noticed that if i override it, it does not fire unless I invoke mybase.[event] in the override but it stll doesn't "hide" it from the event list and that is mainly what i want to do, i really don't care if it actually fires, I just don't want it to be accessable to the developer.
  • *Experts*
Posted

If you are making a Windows Forms control, you will need to create a custom designer for the control, and override the PreFilterEvents method to remove events.

 

Look at divil's site for an excellent tutorial about adding custom designers to your components. There is also an excellent article here, by Shawn Burke, the man who created much of the Windows Forms implementation in .NET.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...