How to add an item to the TFS source control explorer contextual menu.
-
Thursday, July 05, 2012 5:11 PM
Can somebody please help me with adding my own items to the contextual menu in the TFS source control explorer? I have seen several "answers" to this question in the forums. None of them are very clear though on how exactly to do it.
I have a control I wrote called 'AutoBranch' that I would like to open when somebody right-clicks on a folder in source control explorer and selects a custom item in the context menu named 'Open AutoBranch'. How do I get the item named 'Open AutoBranch' to appear in the contextual menu?
Thank you.
All Replies
-
Monday, July 09, 2012 5:14 AMModerator
Hi AndrejsM,
Thanks for your post!
I think you can use this article for the beginning:
And then refer to the content in the following link:
http://stackoverflow.com/questions/3861946/vs2010-add-in-adding-a-command-to-a-context-menu
Hope it helps!
Best Regards,
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
-
Monday, July 09, 2012 12:35 PMThank you Cathy, I'll give it a try.
-
Thursday, July 12, 2012 4:51 PM
Hi, I looked here;
http://msdn.microsoft.com/en-us/library/cc826118.aspx
But there are no GUIDs and IDs of context menus. I accidently found out that "IDM_VS_CTXT_CODEWIN" is the codewindow context menu. Where can I find a list of the rest of the context menus in VS? Thanks.
-
Monday, July 16, 2012 1:49 AMModerator
Hi AndrejsM,
Thanks for your feedback and sorry for the delayed response!
Do you mean you want to know the VsMenus Fields? Please refer to http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.vsmenus_fields.aspx
Please feel free to let me know if it works!
Best Regards,
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us
-
Monday, July 16, 2012 2:00 PM
Hi Cathy. Thanks a lot for your patience and trying to help me out. I have included a picture to help explain. As you can see, I have right-clicked the 'MAIN' folder item in the Source Control Explorer. What I am trying to do is have my own custom item appear in the context menu. I have written an extension called 'Autobranch' that I would like to appear there. I can get 'Autobranch' to show up in the 'Tools' menu in the main menu ribbon at the top of Visual Studio. However, I don't know how to get it to show up in the context menu in the image below. Can you shed any light on that? Thanks.
-
Friday, July 27, 2012 6:42 AMModerator
Hi AndrejsM,
Sorry for the delayed response!
Could you refer to the following blog about how to add a command to the Source Control Explorer context menu?
Hope it helps!
Best Regards,
Cathy Kong [MSFT]
MSDN Community Support | Feedback to us

