ContextMenuStrip showing only after second right mose click

P

Polanski24

Hello!

I upgraded my legacy .NET 1.1 application to .NET new ToolStrip
controls and everything seems to work OK except some wierd
ContextMenuStrip behaviour.

ContextMenuStrip is bound to several controls on the Form (Form
itselfs, TabControl, DataGrids inside tabs) and in
ContextMenuStrip.Opening event all ToolStripMenuItems are created and
added to the ContextMenuStrip (they are removed and disposed after
use). But the strange thing is that when user clicks the right mose
button for the first time during process lifespan context menu does not
show up. ContextMenuStrip.Opening event is raised, items are created
and added (I checked it with tracing) and menu is not shown. The very
same event raised second time shows context menu.

Now I have changed initial context menu content (it was empty at the
start by design) by adding single dummy ToolStripMenuItem during
initialization which obviosuly is removed and destroyed and everything
works fine.

I do consider this kind of behaviour being a bug - can somone from MSFT
comment on this.

Cheers

http://sourceforge.net/projects/ngmp
 
Top