Menu Controls & Menu Editor oddities

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got some really weird things happening with menus and the form designer,
which I assume are somehow inter-related. I am hoping someone has seen these
and figured out what they are;

1) Sometimes, when I drop a ManiMenu from the toolbox into the component
tray I get an "Invalid Cast" message box popping up. No other information is
available about what the problem is. This problem comes and goes.

2) If I do succeed in getting a ContextMenu or MainMenu into the component
tray, selecting it will cause the from to shrink by 20 units. The menu editor
simply doesn't work, and attempting to use it only results in the form
shrinking. Dropping additional ContextMenus or MainMenus into the component
tray does the same thing.

3) If I hand code the ContextMenus & MainMenus into InitializeComponent(),
everything works - for a while - then all the code gets deleted. I've
resorted to putting it in an InternalInitialize() that I call from the
destructors and everything works.

The end result is I hand code my menus and occasionally have to re-adjust
the form height as a result of this shrinkage.
 
Hello MBryga,

Sounds like some mysterious Designer problem. Never handcode anything in the InitializeComponent() method, as it will surely get overwritten by the Designer.

Best of luck!

Your C# ally ,
RBischoff


M> I've got some really weird things happening with menus and the form
M> designer, which I assume are somehow inter-related. I am hoping
M> someone has seen these and figured out what they are;
M>
M> 1) Sometimes, when I drop a ManiMenu from the toolbox into the
M> component tray I get an "Invalid Cast" message box popping up. No
M> other information is available about what the problem is. This
M> problem comes and goes.
M>
M> 2) If I do succeed in getting a ContextMenu or MainMenu into the
M> component tray, selecting it will cause the from to shrink by 20
M> units. The menu editor simply doesn't work, and attempting to use it
M> only results in the form shrinking. Dropping additional ContextMenus
M> or MainMenus into the component tray does the same thing.
M>
M> 3) If I hand code the ContextMenus & MainMenus into
M> InitializeComponent(), everything works - for a while - then all the
M> code gets deleted. I've resorted to putting it in an
M> InternalInitialize() that I call from the destructors and everything
M> works.
M>
M> The end result is I hand code my menus and occasionally have to
M> re-adjust the form height as a result of this shrinkage.
M>
 
All that is in InitializeComponent() is a call to my own routine
InteranalInitialize() where I've put my hand coded menus. However, the
problem existed before I resorted to hand coding the menus - that was my work
around.

With or without my hand coded menus the problems remain.
 
Back
Top