Hi,
I am setting the context menu via the InitializeContextMenu event as shown in KB010088. The first time the event fires I set the context menu but is does not appear. The second time I use the right mouse click the menu appears. If I then click on another tab with a right mouse click the context menu that was previously set still appears and the next time the correct context menu appears. The KB010088 sample program exibits the same behaviour.
What do I need to do to have the menu appear correctly?
Thanks
Rich
Good find, it looks like the KB article is incorrect. The problem with setting the ContextMenuUltra in the InitializeContextMenu event handler is the right mouse button has already been clicked down and released. When SetContextMenuUltra is called, the toolbars manager will start looking for the right-click events, but in this case they have already happened, so the call is too late. Instead, you should just show the context menu. You can do this in the KB sample by replacing this line:
this.ultraToolbarsManager1.SetContextMenuUltra( this, "File" );
with this line:
this.ultraToolbarsManager1.ShowPopup( "File", this );