简体   繁体   English

在CE5设备上使用.NET CF创建按钮时出现NotSupportedException吗?

[英]NotSupportedException when creating button with .NET CF on CE5 device?

I have an application that runs well on WinCE and WM devices (all that I have tested so far). 我有一个在WinCE和WM设备上运行良好的应用程序(到目前为止,我已经测试了所有这些)。 I have just received a new device to test on and the Form throws a NotSupportedException when the designer creates a button on the device. 我刚刚收到一个要测试的新设备,当设计人员在设备上创建按钮时,Form引发NotSupportedException。

The device is a Motorola EWP2100 Wifi Phone. 该设备是Motorola EWP2100 Wifi电话。 According to its about page it runs WinCE 5 根据其关于页面的信息,它运行WinCE 5

Here is the full exception it throws 这是它抛出的全部异常

System.NotSupportedException occurred Message="NotSupportedException" StackTrace: at Microsoft.AGL.Common.MISC.HandleAr() at System.Windows.Forms.Control._InitInstance() at System.Windows.Forms.Control..ctor() at System.Windows.Forms.ButtonBase..ctor() at System.Windows.Forms.Button..ctor() at SmartLane.Config.InitializeComponent() at SmartLane.Config..ctor() at SmartLane.MainForm.ShowConfig() at SmartLane.MainForm.MainForm_Load() at System.Windows.Forms.Form.OnLoad() at System.Windows.Forms.Form._SetVisibleNotify() at System.Windows.Forms.Control.set_Visible() at System.Windows.Forms.Application.Run() at SmartLane.Program.Main() InnerException: 发生System.NotSupportedException消息=“ NotSupportedException” StackTrace:在Microsoft.AGL.Common.MISC.HandleAr()在System.Windows.Forms.Control._InitInstance()在System.Windows.Forms.Control..ctor() .Windows.Forms.ButtonBase..ctor()(在System.Windows.Forms.Button..ctor()在)SmartLane.Config.InitializeComponent()在SmartLane.Config..ctor()在SmartLane.MainForm.ShowConfig()在System.Windows.Forms.Form._OnLoad()(位于System.Windows.Forms.Form._SetVisibleNotify()-位于System.Windows.Forms.Control.set_Visible()-System.Windows.Forms处的SmartLane.MainForm.MainForm_Load()。 SmartLane.Program.Main()处的Application.Run()InnerException:

The code that throws it is here: 引发它的代码在这里:

    private void InitializeComponent()
    {
        this.label1 = new System.Windows.Forms.Label();
        this.txtServerAddress = new System.Windows.Forms.TextBox();
        this.btnOK = new System.Windows.Forms.Button(); //<---- THIS THROWS
        ...
    }

I know its quite a specific thing to ask, but I have never run into this problem before and the Exception doesn't really give me a clue as to what's going wrong here. 我知道这是一个非常具体的问题,但是我以前从未遇到过这个问题,并且Exception并没有真正为我提供有关这里出了什么问题的线索。

I appreciate any advice or suggestions. 我感谢任何建议。 Thanks 谢谢

You are probably using Smartphone (Standard) SDK, which doesn't support Buttons. 您可能正在使用不支持按钮的Smartphone(标准)SDK。

See also this question . 另请参阅此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM