0

I've created a UserControl. Let's imagine that code:

public class MyUserControl : UserControl
{
  Button button1;
  Button button2;

  //...
}

With that UserControl i can click on one of the buttons and this fires some events (Button1Clicked, Button2Clicked).

Now with the UserControl there are some other events, but i never use that events like MouseMove or Dragging (DragEnter, DragLeave, DragOver, ...). Intellisense shows a huge list of events that are useless in my UserControl.

Is there a common way to hide those inherited events? My main reason is intellisense but also documentation (XML-summaries).

fedab
  • 978
  • 11
  • 38
  • Are you just trying to limit what intellisense is showing you? Why are you trying to do this? – crthompson Jun 30 '14 at 14:14
  • No, Only if it were an interface you could choose to hide them via explicit implementation, but now you are stuck with the underlying declaration. – Silvermind Jun 30 '14 at 14:16
  • fedab, I've changed title of your post to say "hide" - please see if edit matches your goal (looked like intellisense was the only concern), otherwise feel free to rollback the change (or even ask new question if need intellisense change and something else). Note that it may be already covered in http://stackoverflow.com/questions/9086136/how-to-hide-public-methods-from-intellisense?rq=1 – Alexei Levenkov Jun 30 '14 at 14:21
  • Intellisense shows [almost](http://stackoverflow.com/q/17500/1997232) everything, what you *may* want to use. While it's a bit too much to choose, quite soon you will remember names and will type starting symbols or even words when using it to simply *autocomplete*. For browsing purpose (questions like "which methods this control has") best is to use MSDN. – Sinatr Jun 30 '14 at 15:10

1 Answers1

0

As the comments reveal: No, there is no way to hide inherited events from Intellisense.

It is probably a bad decision too. If there would be a way, what if you forgot to unhide it when you implement it? Nobody would see that method but it would be there and if you type it, it would work. That would be a little bit odd.

fedab
  • 978
  • 11
  • 38