MenuItems.Clear() Problem

  • Thread starter Thread starter Davie
  • Start date Start date
D

Davie

I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different context menus on one form. I had tried to declare two MainMenu items and then simply switch the display accordingly. eg.


public void displayPanel1(){
this.Menu = this.mainMenu1; //
this.Refresh();
}

public void displayPanel2(){
this.Menu = this.mainMenu2;
this.Refresh();
}

but this throws a not supported exception. I am aware that smartphone allows only one menuitem on the left softkey and multiple on the right softkey. I have adhered to this policy. I then tried to have one MainMenu and just clear all menuitems then populate the menu depending on which panel i display.

this.rightmenuItem.MenuItems.Clear();

this.rightmenu.MenuItems.Add(this.next_menuItem);

this.rightmenu.MenuItems.Add(this.exit_menuItem);

Again this throws a Not Supported Exception when i try to Clear the list of MenuItems. I have tried the code on Pocket Pc and this works, how can i display menus on the smartphone? I have found things on google, but that is where people have placed menuItems on the left hand side.

Any help would be appreciated.

Davie.
 
Hi Davie,

Thank you for your posting. Regarding on the issue, I am
finding proper resource to assist you and we will update as soon as posible.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)



--------------------
| From: "Davie" <[email protected]>
| Subject: MenuItems.Clear() Problem
| Date: Wed, 5 Oct 2005 02:01:37 +0100
| Lines: 114
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_000A_01C5C950.B80A5A20"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: client-82-14-66-221.brnt.adsl.virgin.net 82.14.66.221
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.csharp:126653
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I'm developing an application on the smartphone. To reduce the size of
the application i'm using panels where appropriate instead of forms. As a
result of the design, I need to have different context menus on one form.
I had tried to declare two MainMenu items and then simply switch the
display accordingly. eg.
| public void displayPanel1(){
| this.Menu = this.mainMenu1; //
| this.Refresh();
| }
| public void displayPanel2(){
| this.Menu = this.mainMenu2;
| this.Refresh();
| }
| but this throws a not supported exception. I am aware that smartphone
allows only one menuitem on the left softkey and multiple on the right
softkey. I have adhered to this policy. I then tried to have one
MainMenu and just clear all menuitems then populate the menu depending on
which panel i display.
| this.rightmenuItem.MenuItems.Clear();
| this.rightmenu.MenuItems.Add(this.next_menuItem);
| this.rightmenu.MenuItems.Add(this.exit_menuItem);
| Again this throws a Not Supported Exception when i try to Clear the list
of MenuItems. I have tried the code on Pocket Pc and this works, how can i
display menus on the smartphone? I have found things on google, but that
is where people have placed menuItems on the left hand side.
| Any help would be appreciated.
| Davie.
|
 
Hi Davie,

As far as I know, this is a limitation of .NET compact framework on
SmartPhone. Can you try to delete the mainmenu and recreate it? Please
check the following thread for reference.

http://groups.google.com/group/microsoft.public.smartphone.developer/browse_
frm/thread/8c676f112fcca1a3/a98db4c74fb7f211?lnk=st&q=smartphone+menuitems+c
lear&rnum=3#a98db4c74fb7f211

http://groups.google.com/group/microsoft.public.smartphone.developer/browse_
thread/thread/78fca888977acea4/f29db9663a6902ca?lnk=st&q=smartphone+menuitem
s+clear&rnum=2&hl=en#f29db9663a6902ca

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
You're welcome.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top