InputPanel shared between several forms?!

Hi,

I have a .NET CF 2.0 application with several Forms each with an InputPanel control.
I got a similar error to the one described in this post:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1441229&SiteID=1

As advised in the cited post, I make sure to dispose all the controls of the form before disposing the form itself but still I have the same bug.

While debugging my application I noticed that if I set a breakpoint in a inputPanel_EnabledChanged event handler, the debugger stops at it, even if it is not the event handler from the method I am debugging! It looks like .NETCF shares the same instance of the SIP across all the forms. Is this some known bug?

Thanks.

[705 byte] By [dabd] at [2008-1-9]
# 1

Hi,

Try unsubscribing the change event of the input panel in the form closing event:

Code Snippet

this.inputPanel1.EnabledChanged -= new System.EventHandler(this.inputPanel1_EnabledChanged);


For me this one also worked:
Code Snippet

this.inputPanel1.Dispose();


Best Regards
Chunsheng Tang
ChunShengTang-MSFT at 2007-10-3 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...
# 2
ChunSheng Tang - MSFT wrote:

Hi,

Try unsubscribing the change event of the input panel in the form closing event:

Code Snippet

this.inputPanel1.EnabledChanged -= new System.EventHandler(this.inputPanel1_EnabledChanged);


For me this one also worked:
Code Snippet

this.inputPanel1.Dispose();


Best Regards
Chunsheng Tang

It worked. Also I noticed in the designer generated code that the inputPanel is not added to the Controls of the form, so you have to dispose it explicitly.

Thanks!

dabd at 2007-10-3 > top of Msdn Tech,Smart Device Development,.NET Compact Framework...