私はC#で書かれたWindowsモバイルアプリケーションを持っています。イベントが発生したときにダイアログを更新したいここでは、コードは次のとおりです。Windows Mobile 6 UIの更新の問題
public void ServerStateChanged()
{
// update the interface
try
{
if (this.Focused)
{
this.noConnectionsLL.Text = this.tcpServer.ClientsCount.ToString();
}
}
catch (Exception exc)
{
}
}
コードは数回に動作しますが、その後、私はこのスタックトレースでこれSystem.NotSupportedException
を得る:at Microsoft.AGL.Common.MISC.HandleAr()\r\nat System.Windows.Forms.Control.get_Focused()\r\nat DialTester.Communication.TCPServerView.ServerStateChanged()\r\nat ...
スレッドがイベントをトリガされるから、それは重要ですか?私は何が問題なのか、なぜ数回動いてからクラッシュするのか理解できないからです。