473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can't see event handlers in descendant forms

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
Nov 17 '05 #1
2 1116
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.

"Michael Rodriguez" wrote:
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

Nov 17 '05 #2
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Michael Rodriguez" <mi**@nospamforme.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: delerious | last post by:
I have a DIV that contains some links. I have an onmouseout event handler on the DIV, and I want it triggered only when the mouse leaves the DIV. Since there are Anchors in the DIV, onmouseout...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
1
by: Adam | last post by:
In Winforms, in Visual Studio, how does one add multiple event handlers in the properties box for let's say, a textbox TextChanged event? Thanks in advance. Adam
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
4
by: Rob Richardson | last post by:
Greetings! I am working on an application that targets a Pocket PC running Windows CE and SQL Server CE. Almost all functions in the application use a Try block with a Catch block that looks...
12
by: Benny Raymond | last post by:
I understand that you would normally want to raise an event on the same thread so that your code blocks until the event has been dealt with... however i've run into a situation where I have a...
3
by: Bruce HS | last post by:
When I raise an event in an ancestor, the event fires first in the ancestor, then its descendant, and then in the descendant's descendant. I would like the descendant's descendant to fire first...
0
by: khalid galal | last post by:
Hi, i am having a problem with removing event handlers, it is when creating nested event handlers (an event handler raising another event handler) where a part of the code is private void...
1
by: Lila Godel | last post by:
My VB.NET 2008 application is setup with a Sub Main and no forms. At run time a NotifyIcon is created with one context menu choice (Close which terminates app). I have no trouble running the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.