Buggy .NET CF 1.0 SP3 InputPanel EnabledChanged event?

G

Guest

Hi,

In my PocketPC application, I am using several forms. Some of which are
using the InputPanel for user input. All forms have their own InputPanel
object and a MainMenu object (from before SP3). Some forms have the
InputPanel.Enabled property set to true by design and some don’t. And some
forms are responding to the InputPanel.EnabledChanged event while some don’t.

Now the problem is; that after .NET CF 1.0 SP3 was installed (that addresses
some of the issues with the InputPanel component); - I can not register the
various forms own EnabledChanged events. Only the first form that registers
for this event gets it, and is still referenced too after that form has been
disposed, thus creating an exception with the other forms.

So my question is; - does anyone else know something about this, and what
should I do about it? Am I mistaken?

BRG

Eskild
 
G

Guest

Ok some more info.

I have noticed that even in my main form, after opening, closing and
disposing a user input form, the exception is thrown, when tapping the
InputPanel icon. Tracing into this, shows that the “old†EnabledChanged event
in the disposed form is being called. Obviously this will crash, as the
EnabledChanged method in that form is set to resize its window.

This is a serious problem for me, and unless there I made a huge mistake
here it would be for the .NET CF Service pack too. Is it just me? And how
should I workaround this?

Eskild
 
G

Guest

Ok, found a workaround! I just realised that this was not a problem only with
SP3 of the .NET CF framework. I just didn’t discover it till now. I would
also like to know if this is seen as a flaw or if there are good reasons why
it works like this.

Anyways, - my solution was to manually unhook the InputPanel.EnabledChanged
event when disposing forms that sign up for it. I did this in the overridden
Dispose method of those forms, like this:

protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
this.myInputPanel.EnabledChanged -= new
System.EventHandler(this.myInputPanel_EnabledChanged);
}

And it seems to work.

I would still like to get some input on this, as to understanding the issue
a bit more. Anyone?

BRG

Eskild
 

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