当退出Motorola MC3100上的.NET CF 3.5应用程序(仅限CE 6.0版本)时,我收到错误消息"应用程序xxx遇到严重错误,需要关闭".然后我需要热启动设备以使应用程序再次工作.
此代码在应用程序关闭之前正常工作,并且只有在应用程序中的控件上设置了字体时才会失败.在.NET CF 2.0和我使用.NET CF 3.5尝试过的所有其他Motorola,Intermec,Psion,HHC设备上,一切都运行良好.
这是我目前的测试代码:
[MTAThread]
static void Main()
{
Control oCtrl = new Control();
oCtrl.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold);
// Setting the controls font to null works
// oCtrl.Font = null; Works
// Setting the Control to null does not work, still get error
// oCtrl = null; Doesn't work
// Setting a font, not on a control, also works fine.
// System.Drawing.Font font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold);
}
Run Code Online (Sandbox Code Playgroud)
我看到了一些似乎相关的链接: