Separator line throwing exception in context menu

M

Mark Reddick

I've searched the net and found a couple other people having the same
problem but I found no solution. The general response seems to be that it
should be working in the final version of VS.NET. However, I can't get it to
work. I just tried adding a separator to a context menu in a CF app and it
now throws a NotSupportedException exception when it this the line that sets
the separator menu item (menuitem.text = "-"). Has anyone done this
successfully? If so, how did you do it? I'm using VS.NET 2003 Ent. Arch.
(final release).

Thanks,
Mark
 
S

Serg Kuryata [MS]

Hi Mark,

Please could you send me a sample application that would reproduce the
problem?

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Mark Reddick" <[email protected]>
| Subject: Separator line throwing exception in context menu
| Date: Tue, 9 Sep 2003 09:01:27 -0500
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: proxy.lpsg.com 12.7.1.130
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:33090
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I've searched the net and found a couple other people having the same
| problem but I found no solution. The general response seems to be that it
| should be working in the final version of VS.NET. However, I can't get it
to
| work. I just tried adding a separator to a context menu in a CF app and it
| now throws a NotSupportedException exception when it this the line that
sets
| the separator menu item (menuitem.text = "-"). Has anyone done this
| successfully? If so, how did you do it? I'm using VS.NET 2003 Ent. Arch.
| (final release).
|
| Thanks,
| Mark
|
|
|
 
S

Serg Kuryata [MS]

Hi Mark,

The exception that you get is actually expected. Due to some restrictions
of the operating system, the .NET Compact Framework v1.0 throws the
NotSupportedException if the MenuItem.Text property is to "-" when the menu
item is already added to a context menu and the context menu is already
assigned to a control. A workaround for this problem would be to ensure
that the MenuItem.Text property is set to "-" before the menu item is added
to a context menu or the context menu is assigned to a control (i.e.,
please make sure that "this.menuItem3.Text = "-";" is executed before
"this.textBox1.ContextMenu = this.contextMenu1;").

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Mark Reddick" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Separator line throwing exception in context menu
| Date: Tue, 16 Sep 2003 07:32:36 -0500
| Lines: 56
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: proxy.lpsg.com 12.7.1.130
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.
phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:33480
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Email sent. Thanks for taking a look.
|
| - Mark
|
| | > Hi Mark,
| >
| > Please could you send me a sample application that would reproduce the
| > problem?
| >
| > Thank you,
| > Sergiy.
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| > --------------------
| > | From: "Mark Reddick" <[email protected]>
| > | Subject: Separator line throwing exception in context menu
| > | Date: Tue, 9 Sep 2003 09:01:27 -0500
| > | Lines: 13
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.compactframework
| > | NNTP-Posting-Host: proxy.lpsg.com 12.7.1.130
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.dotnet.framework.compactframework:33090
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| > |
| > | I've searched the net and found a couple other people having the same
| > | problem but I found no solution. The general response seems to be that
| it
| > | should be working in the final version of VS.NET. However, I can't get
| it
| > to
| > | work. I just tried adding a separator to a context menu in a CF app
and
| it
| > | now throws a NotSupportedException exception when it this the line
that
| > sets
| > | the separator menu item (menuitem.text = "-"). Has anyone done this
| > | successfully? If so, how did you do it? I'm using VS.NET 2003 Ent.
Arch.
| > | (final release).
| > |
| > | Thanks,
| > | Mark
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top