views:

380

answers:

1

Hey

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

+3  A: 

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

See also this question.

kgiannakakis
Rofl. After reading the link I never even considered how a user might even press the button on the screen. Thanks!
Chris
They'd use the button the same way people who don't use a mouse on a PC use them: TAB the focus to the button and then hit ENTER (or whatever it's labeled on the phone). I understand why they took it out, but they should have left it in.
MusiGenesis
@MusiGenesis: one of the many places where the CF team apparently couldn't see the forest for all the trees.
ctacke
Not using buttons make the applications consistent with the built-in UI. For users that only owned Windows Mobile devices that makes sense. People who have used other phones find this strange. I had to implement my own Button once, because the client asked for the exact port of a J2ME application to Windows Mobile. I guess this is happening all the time.
kgiannakakis