Is it possible to collapse code in the VB6 IDE? - vb6

I'm looking for a way to collapse my VB6 code.
I found an option but I really hate it :
Tools > Options > Editor Tab > uncheck "Default to Full Module View"
Is there a better way like the #Region "regionName" way used in the VB.NET IDE?
EDIT :
The two small buttons located in bottom left of the code window do the same as mentioned above

No, isn't possible.
About CodeSMART:
may only show the 'branch lines'.
As for the regions, they are simply special comments, but nothing more.
See
http://www.axtools.com/products-codesmart-vb6.php

Related

Turn Off XAML error underlining

This is a simple issue, and I hope someone can help
For reasons I don't think I need to explain, my XAML thinks it has some errors in it in the Visual Studio code editor (which shows as wavy blue underlines across most of my XAML).
Does anyone know how to turn this underlining off in Visual Studio 2012 ?
It's incredibly annoying, and makes my XAML hard to read
Thanks
I would suggest setting the editor for .xaml-files manually.
Go into
Tools->Options->Text Editor->File Extension
Write xaml in the Extension field and choose XML (Text) Editor from the Editor drop down and then click Add.
Your XAML files should now open as ordinary XML files, without error underlining.
You will probably loose a lot of the nice to have features of the XAML editor, but as far as I know (I've struggled a bit with this myself) it is the only way.
Found this on MSDN. There is a specific setting to disable this.
Open the Options dialog by selecting Tools > Options, and then select
Text Editor > XAML > Miscellaneous.
Uncheck the Show errors detected
by the XAML designer check box.
Article from MSDN
It is possible to hide the SquiggleShape by making the surrounding adornment layer hidden or collapsed using the Snoop tool.
To achieve this, the Snoop crosshair tool has to be dragged on the editor window with shift and ctrl keys pressed (keep them pressed a while when releasing mouse button). You should end on some Canvas (with the editor window highlighted), and below there is some ViewStack. Inside, there are some AdornmentLayer, one of which contains multiple SquiggleShape. In the properties section on the right side of the Snoop window, scroll to the Visibility row and select the value Hidden or Collapsed. Now, the squiggle lines are not visible any more.
This involves some manual work, but as long as the file stays open, the squiggle lines are hidden. In principle, it should be possible to write an extension which hides the lines automatically. However, at the moment I don't find the time to do this...
The only decent fix for this silly bug that I can find is right click on the xaml and click open with. Select source code editor (without with encoding). Not a great fix when you consider it gets rid of important errors. But it should help you read it better for the most part.
Another Option for this is to change the color of the line under: Tools > Options > Environment > Fonts and Colors. Change it to the same as the background.
It will turn it off in all other editors also though.

Is it possible to hide outline margin in Visual Studio 2012?

In Visual Studio 2012 it's a lot of margins to the left of source code text: Indicator Margin, Selection Margin and Outline Margin. As an old programmer i prefer an uncluttered text, so i want all 3 margins to be hidden from me. In Text editor settings i can hide indicator and selection margins, but i didn't found how to hide an outline margins. Outline graphics (all this "+" things and ines) can be easily hidden from "edit" menu, but margins itself remains. Is it possible to hide it or such feature is not implemented? In previous versions of Visual Studio it auto-hides if "selection margin" was disabled, but now it seems that it don't hide at all :(.
Update
A little clarification why I need it. As correctly mentioned in comments, it's very unusual to have preferences for text formatting and appearance. I agree with that. Unfortunately, in my personal case, I work with text like 10 hours per day for dozens of years and my brain is kind of trained to calculate indentation from text editor left edge. And every time I work in Visual Studio my "wrong indentation" instinct is often triggered by this empty space :). Of course i can re-train myself, but since ALL editors except Visual Studio displays text close to left edge, I will try to configure Visual Studio first.
Turn off the Indicator margin with Tools + Options, Text Editor, General, untick "Indicator margin"
Turn off the Selection margin with Tools + Options, Text Editor, General, untick "Selection margin"
Turn off the Outline bar with Edit + Outlining, Stop Outlining. That is however liable to come back when you open a new file. You can make it consistent for the C# IDE with Tools + Options, Text Editor, C#, Advanced, untick "Enter outlining mode when files open". If you want to do this for other kinds of files as well then you need to write an add-in that listens for the DocumentEventsClass.DocumentOpened event.
I've created an extension for this, it's for VS2015 but if you haven't upgraded yet it should work for VS2012 as well (assuming you're using an edition that supports extensions). The source code is only a few lines and is shown in the screenshot of the posted link.
http://blogs.msdn.com/b/saraford/archive/2007/09/13/did-you-know-you-can-hide-outlining-selection-margin-without-turning-off-outlining.aspx
Tools – Options – Text Editor – General, and uncheck Selection Margin...
This work?
Go to VisualStudio->Tools->Options
Drill down to Text Editor->C#->Advanced and uncheck "Enter outlining mode when files open"
Other language editors have similar options to disable outlining mode.
Any files you have open before changing this setting need to be re-opened, or you can turn off outlining from the context menu for each open file. Easier to just close/re-open.
Hope that helps!
Here's an extension that worked perfectly for me: https://marketplace.visualstudio.com/items?itemName=JustinClareburtMSFT.HotSettings
It has custom options to hide/show:
the entire margin
breakpoint margin
line numbers
selection margin
I can't tell if anyone actually answered your question (which is mine today!). Please see http://www.codeproject.com/Articles/109611/Color-Indicator-for-Code-Changes-Track-Changes-in and particularly the "Enable / Disable" section: "Go to Tools > Options > TextEditor. In General section, you can check or uncheck the 'Track Change' option."
Agree this feature is a big visual hassle during initial development, but it can be helpful during "maintenance" changes.
Corrected per "external link" comment.

Find Unused public functions

Is there a way to automatically find all unused public functions in a solution? I have resharper, and right now I have to do a "find usages" on each symbol, which is tedious--it seems like there should be a better way
Of course there's a better way. Here's what you should do if you use ReSharper 4.5 or later:
Go to ReSharper > Options > Code Inspection > Inspection Severity.
Scroll down to "Unused symbols" category and set all containing items called "Non-private accessibility" to be shown - whether they're shown as hints, warnings, or suggestions is not relevant and is entirely up to you.
In ReSharper > Options > Code Inspection > Settings, check "Analyze errors in whole solution". Press OK to apply changes in ReSharper Options.
Right-click the solution node in Solution Explorer, and select "Find code issues".
ReSharper will display various code issues that it detects in your solution in "Inspection results" tool window. Specifically, under "Unused symbols", you'll see all non-private types and members in your code that are not used.

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

What are your most-recommended Visual Studio preferences? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?
Line Numbers
Tools > Options
Text Editor > All Languages > General
Display: Line Numbers
Environment->General->Animate environment tools => OFF.
Speeds UI responsiveness by 82%.
I've never found dynamic help to be either dynamic or helpful, and just tends to slow visual studio down, so using regedit:
registry key:
HKEY_CURRENT_USER\Software\Microsoft\Visual Studio\x.x\Dynamic Help
value:
Never Show DH on F1 = yes
I'm also keen on setting the following in Options->Projects and Solutions:
Show Output window when build starts - checked
(IMHO easiest way to spot build errors)
Track Active Item in Solution Explorer - unchecked
(stops every project ending up fully expanded in Solution Explorer)
Gotta have the tab indention set up right.
Also, Consolas & Color Themed - white backgrounds hurt my eyes
Option Strict On
Tools > Options
Projects and Solutions > VB Defaults
Default project settings: Option Strict: On
Tools -> Options -> Environment -> Keyboard
Setup a shortcut to close the active document. Ctrl+Alt+W in my case.
Personally i hate that VS defaults to "Tab to Spaces" when you are developing in C#. This is so awkward to work with and unnecessary.
Yes, i know there are issues with Tabs but honestly, did any of you ever encounter them coding in C# on Windows?
Several have mentioned custom keybindings. Here are handy default keybinding reference posters…
Microsoft Visual Basic Default Keybindings reference poster
A high quality, print-ready PDF
containing the useful keybindings for
developers that choose the Visual
Basic developer profile in Visual
Studio 2008 or use Visual Basic
Express.
Microsoft Visual C# Default Keybindings reference poster
Visual C# in Visual Studio 2008 and
Visual C# 2008 Express Edition Wall
chart showing useful keyboard
shortcuts for Visual C# programming
language.
I like Microsoft's instructions:
Download and extract PDF
Send to favorite full color printer/copier
Hang on wall
Code
Smile
Set the active document you're working on to display in the solution explorer. I've seen a lot of people hunting for their current doc if the project gets too big.
Tools -> Options.
Make sure show all settings is checked.
Click on Projects and Solutions.
Enable the Track Active Item in Explorer checkbox.
alt text http://img370.imageshack.us/img370/4821/trackactivedocumentqv2.gif
Environment => General => Recent files
24 items shown in Window menu
24 items shown in recently used lists
Environment => General
Show status bar ON
Animate environment tools OFF
Prevent Visual Studio from renaming pasted controls
How do I prevent Visual Studio from renaming my controls?
Window Layouts
This really isn't a setting but something I always do is back up my settings via Tools > Import and Export Settings.
I make sure to back up my window layouts for both single and multiple monitors. It saves frustration when moving from my multi-monitor setup to a single monitor for a presentation.
Not to mention, it makes it easy to get up and running on a new PC.
Visible white space. (Edit -> Advanced -> View White Space)
The default color is too strong. I immediately change it to silver. (Tools -> Options -> Fonts and Colors -> Visible White Space).
On some displays, even silver is too strong, and I create a "light silver".
I'm somewhat surprised to be the first person recommending Visual Studio Hacks for a lot of suggestions of this variety
Fixedsys Font
Tools > Options
Environment > Fonts and Colors
Font: Fixedsys
Always show solution
Tools > Options
Projects and Solutions
Always show solution
Check out this thread for the Color theme options for Visual Studio
https://stackoverflow.com/questions/141371/which-visual-studio-color-theme
And consolas is my favourite font
This applies to winform projects.
Instead of opening the form in design mode by default, you can configure VS to open the code editor instead. This is configured by right-clicking on a form in the solution explorer and choosing the "Open with" option. This gives you a dialog that allows you to specify the default option when double-clicking on a file.
In a control's properties, setting GenerateMembers to false for items you don't need (labels, etc). It's not a specifically Visual-Studio thing, more related to the platform, but mixed with the contextual list of objects and functions, it just clears up so much clutter.
When designing a form:
View > Tab Order
Allows you you specify and control your TabIndexes easily (much more so than setting them by hand!)
Source View
Tools > Options
HTML Designer > General
Start pages in: Source View
Its all about Resharper ;) Gives you tons of shortcuts which are so useful I can no longer work without them. I don't get on with the intellisense though, so I've turned that off.
This is incredibly useful, allows you to write underscores with the space bar when writing long test method names.
Un-Bold Brace Matching
Tools > Options
Environment > Fonts and Colors
Display items: Brace Matching (Hilight)
uncheck Bold
Find and Replace window’s "Search Hidden Text" checkbox.
It's not really a preference but it is indispensable. It sure is frustrating when you don’t notice that it "magically" unchecked itself.
Besides, Line Numbers, the first thing I always do in a newly-installed IDE is set the Edit.GoToDefinition keyboard shortcut.
Tools > Options > Keyboard

Resources