Jump to content


NotSupportException in Menu control

- - - - -

  • Please log in to reply
4 replies to this topic

#1
bdmoore

bdmoore

    Task for the day: Think of interesting entry for here....

  • Members
  • PipPipPip
  • 196 posts
  • Gender:Male
  • Location:Swindon, UK
  • Devices:Touch Diamond, i780, TyTN II
Hi,

I've got a strange problem with an app I am developing.  The following line (from the Windows Forms Designer auto generated section!) throws a NotSupportedException:

  this.Menu = this.mainMenu1;

I created the menu using the form designer and so would expect it to work!  I'll try creating it from scratch instead but if anyone could tell me where I'm going wrong it would be much appreciated!

Cheers :)


#2
Habanero

Habanero

    Newbie

  • Members
  • Pip
  • 1 posts
The MenuItem class has the following restrictions:

- You can have no more than two top-level menu items.
- Only the second top-level menu item, on the right side of the form, can have sub-menus.

These aren't enforced at design time but will cause that exception at run-time.

Hope this helps.

Habanero


#3
bdmoore

bdmoore

    Task for the day: Think of interesting entry for here....

  • Members
  • PipPipPip
  • 196 posts
  • Gender:Male
  • Location:Swindon, UK
  • Devices:Touch Diamond, i780, TyTN II
@Habanero,

Thanks for that :)

I was trying to put a sub menu on the left hand menu, that must have been causing the problem!

Seems a bit of a stupid restriction tho, would like to know the reasoning behind that decision  :?

Cheers :D


#4
ultimasnake

ultimasnake

    Addict

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Amsterdam Holland
  • Interests:Programming<br />Gaming<br />Woman :P
  • Devices:Imate JAM/Orange E200
hmm that was my problem too.. never would have found it out myself.. kinda sucks though.. either Evc++ can do it... or some programs found a way around this problem (smartexplorer)

Current Project :
Smart commander
Great new application to control your pc

Smart Browser the (first) PIE alternative
Click here for the official website

Try some other great free software like :
Gaydar
Homers Bar Quotes
Erotic dice

and soon more at ultimasoftware

#5
bdmoore

bdmoore

    Task for the day: Think of interesting entry for here....

  • Members
  • PipPipPip
  • 196 posts
  • Gender:Male
  • Location:Swindon, UK
  • Devices:Touch Diamond, i780, TyTN II
You only get this problem with .Net CF apps as the framework enforces MS's rules / standards.  With EVC++ you can do what you want - I just don't know it!!

And yeah it does kinda suck!  :lol:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users