camalot Posted August 2, 2003 Posted August 2, 2003 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. Quote
JABE Posted August 3, 2003 Posted August 3, 2003 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. Quote
camalot Posted August 3, 2003 Author Posted August 3, 2003 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. Quote
JABE Posted August 4, 2003 Posted August 4, 2003 Try declare the event w/ Shadows in the child implementation (assuming you're using VB.NET, of course). Quote
*Experts* Volte Posted August 4, 2003 *Experts* Posted August 4, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.