Hide some event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cfyam

    #1

    Hide some event

    I made a new UserControl, and I want to hide some event (like click..) when
    the other user use the control view the property page! How can I do?


  • Eric Cadwell

    #2
    Re: Hide some event

    I tried a few things and it doesn't look easy.

    If you just want to hide the event from the designer set the Browsable
    attribute in the derived class:
    [Browsable(false )]
    public new event EventHandler Click;

    Otherwise, if you needed to completely remove it from the interface:
    Maybe hack the IL? Or inherit from Component, but that would strip you of
    lots of base functionality.


    HTH;
    Eric Cadwell



    Comment

    Working...