简体   繁体   中英

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). 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.

The device is a Motorola EWP2100 Wifi Phone. According to its about page it runs 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:

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.

I appreciate any advice or suggestions. Thanks

You are probably using Smartphone (Standard) SDK, which doesn't support Buttons.

See also this question .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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