How to add custom button to Visual Studio Output Window toolbar - visual-studio

I'm trying to build an extension to Visual Studio with a couple of custom commands. It is well documented how to add commands to VS Menu/Toolbars. There are also many samples how to add custom button to the Project Explorer Toolbar. The problem is that best (most suitable) toolbar for my command is those on the top of Output Window.
So, there are two questions:
Is it possible?
If yes then how to achieve this?

1) It is really possible. It looks like any toolbar and any menu could be extended by any command.
2) The method of extending is the same for all toolbars (and menu). What you need to know is toolbar's ID. ID could be found in file vsshlids.h placed in your installed VSSDK inc folder. For output window toolbar this ID is IDM_VS_TOOL_OUTPUTWINDOW.

Related

Add toolbar button to TFS' "My Work" in Visual Studio

I find I go to the My Work pane inside the Team Explorer frequently, but I haven't found a way to get there in one click. I can create a shortcut key for the command TeamFoundationContextMenus.Commands.GoToMyWork and that works, but I'm looking for something I can click on a toolbar.
So specifically, my question is: where in the toolbar customization "Add Command" list does this option exist? There are several categories and many items in each, and I haven't found a way to search, only scroll.
More generally, and if the option doesn't exist, is there a way to use the command name in the keyboard shortcut customization to create a toolbar button for that command?
For a toolbar you can add commands only from the existing VS menu.
For additional commands, you can create an intermediate Visual Commander command DTE.ExecuteCommand("TeamFoundationContextMenus.Commands.GoToMyWork") and then add this VCmd.Command01 command to a toolbar.

Editing File system in Visual Studio 2010Installer

I am trying to add a shortcut to the exectuable in the user's start menu.
There are many answer on StackOverflow that detail how to do this.
However, the all say something along the lines of 'Right click in the right-hand pane to...'
So I understand you all have an interface that looks something like:
I don't have the panel on the extredme right - entitled 'Name' containing the Primary Output.
I have gone through every menu option I can find to enable this pane, but can't find it.
Anyone know how to show this window?
I am wondering wether or not the splitter has been dragged all of the way to the right. Try collapsing all of your side menus like the solution / property / toolbox etc.. to make sure that the File System editor is filling the entire window then look if you can see a splitter to the right. I have not found any way to delete that panel yet. You can also try right clicking on the File system Tab and tell it to float then make it go full screen to see if the splitter is visible then.
I had the same problem, tried to find another splitter but couldn't, got the 2nd detail pane by opening Visual Studio 2010 using the 'Run as administrator' command.

Creating a toolbar button that runs a Macro in VS2010

I've created a MACRO in visual studio 2010 that builds my project and attaches it to several processes. Unfortunately, unlike in vs2008, I can't add it to a toolbar so I can run it with a press of a button; after looking it up I found out the guys at Microsoft left the option of adding a macro button out of vs2010:
http://social.msdn.microsoft.com/Forums/en-CA/vsx/thread/87455de6-2a7d-42dd-b51f-ddd442c3e3fd
Am I wrong and there is a way/workaround that can solve this?
It's possible. Tools + Customize, Commands tab, Toolbar radio button. Use the combo to select the toolbar you want to change. Add Command button, Categories = Macros, select the macro in the Command list. Modify Selection to alter the button properties.
What you can't do is select an image for the new button. That's indeed stunningly lame, looks like they just didn't have time to get it done. You can add your vote to this feedback article. But surely on the todo list for the next version already.

Customizing toolbar items in VS2010

Has the menu & toolbar customization functionality in VS2010 been reduced?
I can't seem to be able to select an icon for an added command, nor set it to be icon-only. Previous versions of Visual Studio supported this functionality and even allowed the creation/editing of custom icons.
Is this something that has suffered as a result of the move to the WPF-authored UI or am I missing something?
Seems like this functionality was cut from Visual Studio 2010. This post has some info in the comments: Customizing Visual Studio 2010
Specifically - "Unfortunately assigning or editing icons to commands through Customize dialog is not possible in VS2010. It is one of the features got cut for lack of time. This is however something we'll consider adding back in next version."
The reply also has a longer explanation of a workaround.
As noted in the link mentioned in the answer from #Gordon Mackie JoanMiro, the REASON for the reduced functionality is that the VS Shell team migrated the entire UI (shell and command system) from Win32 to one based solely on WPF. This was a gargantuan task, I would imagine. However, a couple workarounds are now available:
You can export previously saved settings from VS 2008 and import them into VS 2010. That includes command bar customizations (as noted by #Don)
A more recent blog-post contains detailed instructions for using a new extension to VS2010 (available on Visual Studio Gallery) that allows users to change the images on the command UI. (Note that the old drag&drop customization interface is still not supported in this new extension.)
If you have custom icons, any attempt to make ANY changes to the tool bar will result in the custom icons disappearing and being replaced by text when you restart VS2010.
The only way I found to get my custom icons without text into VS2010 is to open VS2008, set up all of the tool bars the way I want, including custom icons, then export the settings (Tools| Import and Export Settings). Then open VS2010 and import those settings. Tedious, I know, but it allows me to have a down arrow icon that searches for the next instance of the word my cursor is on.
I have been trying to customize VS2010 toolbars/keyboard and what took a few minutes in previous versions takes hours now. The new system looks real pretty but is useless in practice. Apart from the fact you just can't do (like change the appearance of buttons as mentioned above) the things you can do are extremely time-consuming and annoying.
Why is it every new version of VS loses something really useful? Other examples:
VC++5 introduced a new HTML help system. Pressing F1 on a function name used to immediately show help for that function. After VC++5 getting context help became annoyingly much slower, and is still very slow (and inaccurate).
VS.Net (aka VS2002 or VC++7) had a useless bookmark system compared to VC++6. VS2010 bookmarks are better but not perfect.
VS.Net removed the search state buttons "whole word", "case sensitive" etc. These were possibly the most useful buttons ever as they quickly allowed you to see why a search may have failed.
I found a great extension: CommandingImage
It does not have an icon editor, but you can create your images as 16x16 png format (for transparency) and import it (I recommend Paint.Net)
Dave, here's how to add toolbar buttons:
1) in the IDE, find the down arrow looking thing on the far right of a toolbar and click on Add Remove Buttons, Customize
2) in the Customize window select the Menu Bar radio button then select the appropriate menu bar that you want to add a button to
3) click the "Add Command..." button
4) select the appropriate Category and Command button that you want to add, then click OK.
The command button you selected will be added to the menu bar you selected. You can move the button up or down.
I think this is what you are looking for.
Good luck!

Visual Studio window which shows list of methods

In Visual Studio, is there a window which shows list of methods in the active class? A small window like the Solution Explorer would be great. In Eclipse, there is one.
There's a drop down just above the code window:
It's called Navigation bar and contains three drop downs: first drop down contains project, second type and third members (methods).
You can use the shortcut Ctrl + F2 (move focus to the project drop down) and press Tab twice (move focus to the third drop down) to focus it, down arrow will expand the list.
Full size image
I found how to turn the drop down on as shown in the first answer (#ChrisF):
Go to Options->Text Editor->(your language)
and tick "Navigation bar" in the display section.
Since Visual Studio 2012, you can view the outline ( fields and methods) in the solution explorer by expanding the node corresponding to your file .
Shortcut to Navigation Bar is Ctrl+F2. Takes you to the types dropdown first. Press tab to go to method dropdown, and then enter on a method to go to that one.
ReSharper has a 'ReSharper | Windows | File Structure' window, which is used for visualizing current code file structure.
Resharper has the File Structure window which is very similar to eclipse outline view. Originally answered in:
Visual Studio 2012: List of all Methods in class
Resharper help:
http://www.jetbrains.com/resharper/webhelp/Reference__Windows__File_Structure_Window.html
Despite it's an old question maybe this answer help you as helped me.
you can download codemaid extension from here : codemaid website
it has a lot of functionality that you may find in their website.
the one that is related to this question is code digging
Visualize and navigate through the contents of your C# and C++ files from a tree view hierarchy. Quickly switch between different sorting methods to get a better overview. Drag and drop to reorganize the code. See McCabe complexity scores and informative tool tips.
in other words it give you ability to see the methods and properties and also reorganize them just with drag and drop. it's my everyday use extension
There is no direct equivalent to the Outline View in Eclipse. The closest thing I've found is the Class View, which lists all classes and their members/methods. There is a search box at the top to narrow the selection.
In Visual Studio 2019, there is the "Go To Member" action located in Edit - Go To that is mapped by default to ALT+\. I think this was added in Visual Studio 2017.
This is what pops up which provides the desired functionality and a couple of options:
In Visual Studio 2015, View > Other Windows > Resource View. The keyboard shortcut is Ctrl+Shift+E. I find this cleaner than Class View. With Class View Windows you can filter methods/attributes based on access modifier (private/protected/public) etc.
A nice clean way to do this is to use the command View.SynchronizeClassView by entering it into the Command Window (View > Other Windows > Command Window or Ctrl+Alt+A) but there's no way to do it automatically.
Additionally, you can:
pin your Class view window
collapse the top pane (listing all the classes)
And now it feels just like the Visual Assist's feature "List Methods in Current File" (which also list members btw).
At the top of your text editor, you should have a dropdown that lists all the methods, properties etc in the current type; and it's clickable (even if those members are defined in other files - in which case they're greyed out but you can still navigate with them).
Also, if you use the Class Explorer (Ctrl+Alt+C) to navigate your project, then you'll get a full overview of all your types. However, there doesn't appear to be a setting in Tools/Options that allows you to track the active type in that window (there is for the solution explorer) - perhaps a macro or addin is in order...
Microsoft doesn't feel like implementing this useful tool, but if by chance you can have Visual Assist, you have it in VAssistX > Tools > VA Outline. The plugin is not free though.
In Visual Studio 2005 and 2008 you can try the Source Code Outliner Power Toy.
alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SourceCodeOutliner&DownloadId=3493
Do you mean the class view window (View->Class View, or Ctrl+W,C)?
You also have the intellisence popup-window
With Visual Studio 2010
You choose Tools->Settings->Expert Settings
On the left-bottom corner, you will see the tab "Class View" right next tab "Solution Explorer"
In the top area of "Class View" layout, you will see the list of class name, enum, struct, ...
In the bottom area of "Class View layout, you will see the list of member for these class, enum or struct
I have been using USysWare DPack since forever. It is very small and not intrusive so if all you want is a quick shortcut window showing list of methods of the current file you are using, it provides just that. Good thing is that the author is still active after more than 10 years just to keep providing the same features into latest VS release.
https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348
After installation, just use Alt + M to bring up the method list window. I prefer to show all members instead, but it's up to you.
In VS 2012, just go to View > Class View...then you get the Class View GUI in the main tab area. Now, drag this over to the side dock and you have the exact same layout as you would in Eclipse.
-e
My best way to do this is, that i open the Code Definition Window, under View -> Code Definition Window or press Ctrl + W,D .
And then i got it floated and i have the definitions of methods in separate windows.
Regards
grep -i " sub " filename.vb > methods.txt
grep -i " function " filename.vb >> methods.txt

Resources