If I highlight a variable named "abc", and I also have a method named "abc1", the abc in abc1 get lightly-highlighted.
I tried preventing that by unchecking Tools > Options > Text Editor > C# > Advanced > Highlighting > Highlight related keywords under cursor [what does that even mean?] but to no avail.
Is there a way to prevent that?
(VS version 17.4.2)
This is the Selection Match Highlighting feature.
The selection match highlighting is a new feature to help you quickly
find additional occurrences of a string in the document you’re
editing.
When it’s checked, any time you select something in your editor, anywhere else that exact string occurs will be subtly highlighted both in the editor and in the scrollbar.
To disable, uncheck the "Show selection matches" checkbox
Tools > Options > Text Editor > General > Show selection matches
Related
When formatting code in Visual Studio 2019 I cannot indent the code with TAB key to line up parts of my code. I know in VS Code there is "Toggle Use of Tab Key for Setting Focus" - however, I could not find this in Keyboard options. Instead it highlights next segment of the code, e.g. variable name.
How do I get TAB to indent my code normally again?
Screenshot showing the highlighting. Happens every time after pressing tab after accessor keyword:
How can I change the "Convert to full property" template to not prefix private fields with underscore?
Right now it does this...
...But I don't want to have underscore prefixes on my fields.
I also don't want them to be in a single line if it's a full property.
Thanks in advance :)
You can change that in the options of Visual Studio.
In the options (menu Tools > Options...) navigate to
Text Editor > C# > Code Style > Naming
Click the button Manage styles and define your own style (e.g. "camelCase").
Under "Private or Internal Field" choose your desired style.
The templates will use these style settings.
Btw.: the underscore is there to differentiate the fields from the local variables and method parameters. In VB the prefix "m_" is often used for fields. "m" stands for "member", (e.g. m_myField).
I have Resharper installed in Visual Studio, and am using the standard 'dark' theme, and somehow I managed to change something so that the '{0}' characters in a format string are no longer colored differently than the rest of the string.
For example, in the following line:
Console.WriteLine("Hello {0}", Environment.UserName);
The quoted string is entirely the same rust color (as it appears in this SO editor), whereas previously the '{0}' was highlighted with a bright greenish color.
EDIT
The settings under 'Resharper Format String Item' appear correct:
Also, the R# Code Annotations is set to JetBrains.Annotations, and is set as the default:
Would some other setting override this? Is there an easy way to just reset everything back to defaults?
I've found the element in the change font dialog. It was a nightmare, hope it helps.
As you've already noted, Resharper knows what color to use for this according to the setting here:
Options > Environment > General > Fonts and Colors the Resharper Format String Item setting.
However, R# knows which methods to apply that color to by using its internal Code Annotations feature.
Check under Resharper > Options > Code Inspection > Code Annotations , and make sure that JetBrains.Annotations is checked, and that it is selected as the default annotation namespace at the bottom of that screen.
I'm working on Microsoft Visual Studio 2003.
I'm searching for a way to suppress a column if it is empty and replace the blank space left by the other columns.
I'm searching everywhere but I can't find a compatible way to the version 2003.
Does exist a simple way?
I appreciate any help.
Crystal Reports doesn't have an automatic (or easy) way to dynamically move columns.
You might consider multiple header and details sections that could approximate this--simply suppress the sections that contain the fields with NULL values.
Right click on the report object and select Format Field. On the Format screen -> Number tab click the Customize button. On the Custom Style screen -> Number Tab check the "Suppress If Zero" box.
But i don't think it can exist in version 2003
Right Click on the field click on Format Object next go to Common Tab -> there you will see Suppress Check box (check that checkbox) next to that there is Formula Editor icon click on that next write formula
if isnull({FieldName} ) then
true
else
false
For what it's worth, I was having this issue for a completely separate reason.
I had multiple groups in the report, one of which was a Document Date. Right-clicking the group and going to Group Options, the "Keep Group Together" option was checked. This meant when there were multiple dates they would get moved to a second page and leave a large white space on page 1.
The white space depended on the result set returned by the query; sometimes it showed up, sometimes not, depending on how many records there were with the same date.
Spent a good 2 hours trying to figure that out.
"Keep Together" in the Section expert for the group was UNCHECKED and I didn't even realize there was a "Keep Group Together" option until I stumbled upon it.
I found difficulty in suppressing column name if its field value is null in crystal report in Visual Studio 2008. I write the code ({tableName.FiledName})="".
It is very simple. Just right click the column name, choose format object, then a window will open. In the common tab, check the suppress check box. Click the x-2 icon beside suppress check box, then a format formula editor will open, write the code ({tableName.FiledName})="" then save and exit. If you make error, the editor will popup the message of error. you would notice that column name will be dimmed or disabled.
Follow steps:
Right Click on the field
Click on -> Format Object
Next go to Common Tab ->
There you will see Suppress Check box (check that checkbox) ->
Next to that there is Formula Editor icon click on that next write formula
IIF(isnull({datasetName.column_name}), True, False)
its work fine but can't hide column empty space I think its difficult
I would like to add a button to the top of the list of options returned by Visual Studio's IntelliSense. When the button is clicked, my custom code will be executed (which will, among other things, cause a popup to appear).
I call it 'button' because when the user click the item, I want a popup window to appear, as opposed to the normal IntelliSense action of completing the user's input.
Eg When we input a class name into the text editor, normally the static properties and static methods will appear in IntelliSense. But I want to add another item to the top of that list.
This item should appear at the top of the IntelliSense list, no matter what input/content caused IntelliSense to appear. The item will never change.
Is this possible, and if so, can you provide some direction as to how I should achieve this?
1) In a C# or VB project, open a code file and put the cursor where you want to insert the code snippet.
2) Bring up the code snippet menu in one of three ways:
Press CTRL+K, CTRL+X.
On the Edit menu, point to IntelliSense, and then click Insert Snippet.
Right-click the mouse and then select the Insert Snippet command on the shortcut menu.
3) Select the code snippet from the code snippet inserter and then press TAB or ENTER, or double-click the snippet.
In the IntelliSense property page, clear text box options or check box options for IntelliSense features that you do not want:
Show completion list after a character is typed
Committed by typing the following characters
Committed by pressing the space bar
IntelliSense pre-selects most recently used members applies to IntelliSense for Most Recently Used Members
For more information, see IntelliSense, C#, Text Editor, Options Dialog Box