Using base class event handlers from the IDE

  • Thread starter Thread starter Andrew Ducker
  • Start date Start date
A

Andrew Ducker

My UserControl base class has an event handling method in it. I want
to use this for several controls on a subclass of this base class.
Normally, I can just click on the drop-down and the methods that fit
the correct signature appear - however ones from the base class don't!

If I go in and change the generated code myself, it works - so things
are set up correctly - it just doesn't appear in the dropdown.

Anyone else encountered this?

Andy D
 
Andy,

The reason this is is that the method is created with a private access
modifier, which means that it won't be available to classes that derive from
that.

Change the access modifier to protected and it should show up in the
list in the derived classes.

Hope this helps.
 
Andy,

The reason this is is that the method is created with a private
access
modifier, which means that it won't be available to classes that
derive from that.

Change the access modifier to protected and it should show up in
the
list in the derived classes.

Nope - it was already protected - otherwise it wouldn't have worked when I
tweaked the code by hand. It does work if I go into the code and edit it -
it just doesn't come up from the IDE.

Andy D
 
Back
Top