Can't see event handlers in descendant forms

M

Michael Rodriguez

I have a feeling this isn't possible in C#.

In Delphi, when you define event handlers in a base class form, you can
choose them in the properties window on your descendant forms.

As an example, consider a TopClassForm that has a NumericKeyPress event
handler that handles the KeyPress event of a text box and allows numeric
characters only. Any form you inherit from TopClassForm (again, in Delphi),
can then choose NumericKeyPress directly in the Object Inspector (Properties
Window) of any text box on the screen.

Is this possible in C#, or do I have to code it by hand?

TIA,

Mike Rodriguez
 
G

Guest

If the event is public, you should see it in the designer. Does the base
class define both the delegate and the event, or just the delegate? In order
for it to show up in the designer, the event must be defined and public.
 
I

Ignacio Machin \( .NET/ C# MVP \)

hi,

it should be accesible if you declared it as protected or public.

Now regarding being displayed in the Properties windows, I dont remember but
I think it will not be.
You can access it from code though.


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top