473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Menu Seperator Bug?


I seem to remember that there was a post some time ago about a problem
with using separators in menus.

Basically I am getting an "Unhandled exception of type
system.notsupportedeception"

This happens below the following code line

this.mnuSeperator1.Text = "-";

If I remove this statement then all compiles without error.

Can anyone remind me how to prevent this?

Terry
Nov 16 '05 #1
1 1399
Terry,

this code works and compiles for me without any problems

//menu declartions
private System.Windows.Forms.MainMenu myMainMenu;
private System.Windows.Forms.MenuItem mnuTestMenu;
private System.Windows.Forms.MenuItem mnuItem1;
private System.Windows.Forms.MenuItem mnuSeperator1;
private System.Windows.Forms.MenuItem mnuItem2;
private System.Windows.Forms.MenuItem mnuSeperator2;
private System.Windows.Forms.MenuItem mnuItem3;

//menu initializtion
this.myMainMenu = new System.Windows.Forms.MainMenu();
this.mnuTestMenu = new System.Windows.Forms.MenuItem();
this.mnuItem1 = new System.Windows.Forms.MenuItem();
this.mnuSeperator1 = new System.Windows.Forms.MenuItem();
this.mnuItem2 = new System.Windows.Forms.MenuItem();
this.mnuSeperator2 = new System.Windows.Forms.MenuItem();
this.mnuItem3 = new System.Windows.Forms.MenuItem();

//
// myMainMenu
//
this.myMainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuTestMenu});
//
// mnuTestMenu
//
this.mnuTestMenu.Index = 0;
this.mnuTestMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.mnuItem1,
this.mnuSeperator1,
this.mnuItem2,
this.mnuSeperator2,
this.mnuItem3});
this.mnuTestMenu.Text = "Test";
//
// mnuItem2
//
this.mnuItem2.Text = "Item2";
//
// mnuSeperator1
//
this.mnuSeperator1.Text = "-";
//
// mnuItem1
//
this.mnuItem1.Text = "Item1";
//
// mnuSeperator2
//
this.mnuSeperator2.Text = "-";
//
// mnuItem3
//
this.mnuItem3.Text = "Item3";

//set the menu to form
this.Menu = this.myMainMenu;

Shak.

"Terry" <tp****@ddrums.net> wrote in message
news:MP************************@news.microsoft.com ...

I seem to remember that there was a post some time ago about a problem
with using separators in menus.

Basically I am getting an "Unhandled exception of type
system.notsupportedeception"

This happens below the following code line

this.mnuSeperator1.Text = "-";

If I remove this statement then all compiles without error.

Can anyone remind me how to prevent this?

Terry

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: les_ander | last post by:
Hi, I know that i can do readline() from a file object. However, how can I read till a specific seperator? for exmple, if my files are name profession id #
2
by: Teis Draiby | last post by:
Does this already exist? Something like "\£" that would appear like a "," or "." dependent on the current locale settings. Examples: string stringValue = "1000\£54"...
4
by: Jesper Denmark | last post by:
Hi, I use the double.Parse functionality to convert a number in a text file into a double. However, while this works fine on one computer it doesn't on another. I've found out that it is...
4
by: Jeppe Jespersen | last post by:
How do i create a separator that only show _between_ menu items? I've tried the "StaticTopSeparatorImageUrl" property, but that also gives me a separator before the first item. Likewise, the...
2
by: Joe Cool | last post by:
You know how when you minimize an application, and you then right click on the application's task bar icon, a popup menu appears that has by default the items Restore, Move, Size, Minimize,...
1
by: Preeti | last post by:
Hi all I am a fresher and have been given a requirement in VB.net I have to make an application in VB.net which will run as a system tray icon and will add one or two items in the default...
2
by: Newbie Coder | last post by:
Hi All It's rare for me to ask a question in this newsgroup VB.NET 2003 ONLY - FRAMEWORK 1.1 -------------------------------------------------- How do I check/uncheck an extended System...
0
by: lstuyck73 | last post by:
Hi, I'm using a menu control that uses a SiteMapDatasource to display menu items in a horizontal menu. I want a seperator between each menu item. If I use the StaticBottomSeperatorImageUrl...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.