Not sure if you understand. In VB6 the operation I wanted was not a code
related Item. I could right click the tool bar of the IDE and customize.
The option however to bring up short cut menus to customize appears to
have been removed


Rory


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2002 13:12
To: [EMAIL PROTECTED]
Subject: FW: [DOTNET] Context Menus in VS.NET IDE

Hi

I tried to post this to the list, but it rejected me, so I am sending it
to
you directly.

Add a named command eg MYCOMMAND, then add the command to the popup you
want
with the following code.  Here the item goes in at the first position.

<code>
CommandBar commandBarMYCOMMAND = (CommandBar)commandBars["<INSERT NAME
OF
COMMAND BAR HERE>"];
CommandBarControl commandBarControlMYCOMMAND =
MYCOMMAND.AddControl(commandBarMYCOMMAND, 1);
</code>

It will have the same faceid and caption as those you put into the
AddNamedCommand call.

You can get a list of Command bar names and indexes with a quick macro,
which I dont have to hand, but is something like (sorry about the VB, I
never used it until I hacked out the macro to show the bars)

Imports Microsoft.Office.Core

foreach CB in Application.CommandBars
        Debug.WriteLine("Command Bar Name= " + CB.Name + " Index= " +
CB.Index
next

Or something Like That.

Funnily Enough, I have never got an item to display on any of the
Solution
popup menus.  If anyone has an idea, could you let me know?

Cheers,

SteveH

_____________________________________________________________

Steve Hopkins
Software Architect
direct: +44 (0) 20 74816114
email: [EMAIL PROTECTED]
Workshare Technology
New Loom House
101 Backchurch Lane
London E1 1LU
tel: +44 (0) 20 7481 6100
fax: +44 (0) 20 7481 6101

www.workshare.com <http://www.workshare.com/>

Workshare Technology - Change at Work

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to