Problem with menu registration

Topics: CAB & Smart Client Software Factory
Apr 13, 2006 at 5:05 PM
originally posted by: jefflevinson1

Hi, I'm new to using the CAB and I'm trying to register menu items. I've looked at the Command Quickstart (and even copied the code from it) but I keep getting an error on this line:

ToolStripMenuItem fileItem = (ToolStripMenuItem)Shell.MainMenuStrip.Items"mnuFile";

(this is in the Aftershellcreated event as in the Commands quickstart).
The error is that the Shell.MainMenuStrip is null. I didn't see any way in the application (and this isn't discussed in the labs) to register the main menu (which I have on the shell form) as the MainMenuStrip for the shell. I saw another example which does that (I don't remember where) but when I try to use the register sites with that I also get an error that the Shell.MainMenuStrip is null. I also don't see it being instantiated anywhere either.

I must be doing something wrong so any help would be appreciated.

Apr 13, 2006 at 7:00 PM
originally posted by: matiaswoloski

Hi Jeff,

- Go to the Shell form designer.
- Select the Shell form.
- Make sure the MainMenuStrip in the property grid is set to the instance of menustrip defined.

Apr 13, 2006 at 7:03 PM
originally posted by: jefflevinson1

Sigh. Thanks. I knew it had to be something really dumb that I was missing.