inputpanel event sender

M

Mart

I have an inputpanel_EnabledChanged event handler.
But in the event handler the sender argument is always <undefined value>
when I activate the inputpanel.

When I have a button.Click and point to the same event handler (the one of
the inputpanel), I do get a value for the sender.
What's the diference? How do I know if the inputpanel fired the event?
I don't give args when I declare the event, I do it like this:
inputPanel1.EnabledChanged += new EventHandler(inputPanel1_EnabledChanged);
button1.Click += new EventHandler(inputPanel1_EnabledChanged);

Any ideas?

Thanks in advance!
 
S

Sergey Bogdanov

You are right, the sender of EnabledChanged event handler is always null
(to tell the truth, I don't know why it is null). But event still fires
and you will be notified about EnableChanged event.

Why do you think that a null value is a problem for you?
 
M

Mart

I am using some kind of framework. Every form has a SIP control and just 1
overall eventhandler. I need to know which form matches this inputpanel
because then I know which components to scroll on my form.

Mart.

Sergey Bogdanov said:
You are right, the sender of EnabledChanged event handler is always null
(to tell the truth, I don't know why it is null). But event still fires
and you will be notified about EnableChanged event.

Why do you think that a null value is a problem for you?

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com

I have an inputpanel_EnabledChanged event handler.
But in the event handler the sender argument is always <undefined value>
when I activate the inputpanel.

When I have a button.Click and point to the same event handler (the one
of the inputpanel), I do get a value for the sender.
What's the diference? How do I know if the inputpanel fired the event?
I don't give args when I declare the event, I do it like this:
inputPanel1.EnabledChanged += new
EventHandler(inputPanel1_EnabledChanged);
button1.Click += new EventHandler(inputPanel1_EnabledChanged);

Any ideas?

Thanks in advance!
 

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