Can't create menuitem using C# in Compact Framework!

  • Thread starter Thread starter Gavin
  • Start date Start date
G

Gavin

I'm trying develop a SmartPhone application in C#.
But it's bad!
It just can't create menuitem as following code.
---------------------------------------------------
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();

this.mainMenu.MenuItems.Add(this.menuItem1);
this.menuItem1.MenuItems.Add(this.menuItem11); <- Fail
 
The smartphone is particularly picky about how menus are arrange in order to
comply with the design guidelines. The first menu item (left-hand softkey)
can not have a sub-menu, however the right-hand can. So in your case you
should add a main menu item first with no child items, then add your menu
with sub items so they are placed on the right soft-key.

Peter

--
Peter Foot
Windows Embedded MVP

In The Hand
http://www.inthehand.com
 
Wow! It's really work! I'm so wondering about this picky
rule. However, you just give me another hope to keep
trying on CF in C#. Thanks.
 
Back
Top