TAB highlights next word instead of indenting - c#

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:

Related

How can I make an UltraTextEditor keep my line breaks in edit mode?

I have a winform with an Infragistics UltraTextEditor control. I can type in enter while editing the text. It saves just fine.
However, if I go back into edit mode, the control collapses the text into the same line.
If I leave the control the text resumes its normal format with the line breaks.
How can I make it keep my line breaks in edit mode?
One possible reason for this is when UltraTextEditor enters in edit mode it is rendering MS TextBox and this is where the editing happens. The important thing here is MS TextBox is able to show new lines only when they are represented with \r\n, while UltraTextEditor will show new lines even if they are represented only with \n. This will end with displaying the new lines when not in edit mode, editor handle this, not displaying new lines when in edit mode, TextBox cannot handle this.
If you are manipulating the Value of the editor and changing the new lines from \r\n to \n this is why you are facing this problem. Note manipulating the value does not exactly means you go and change the new lines. This could happen if you, for example, save the value somewhere, e.g. in XML file, and then load it back to the editor.
If you do not find where the new lines got broken you can try to fix the new lines in editor's EnterEditMode event.

Visual Studio 2019 Intellisense replace

I can't understand why intellisense does't want to replace line after dot with suggestion.
I pressed Ctrl + Space, selected suggestion and I expected the eoID to be replaced by fuID. But I got item.fuIDeoID = updItem.eoID;. To complete suggestion I tried to press Enter then Tab and result was same. Can someone explain how to get item.fuID = updItem.eoID; after complete selecting suggestion?
You need to highlight the part you want replaced. Currently your cursor is in insert mode (so to speak). You need to highlight the part you want replaced, bring up intellisense, and select the replacement value.
To replace press SHIFT+TAB or SHIFT+ENTER

How to hide empty columns and keep the remaining columns together in crystal reports [duplicate]

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

How to add a button to Visual Studio Intellisense

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

C# hide and unhide comments

I am trying to find solution how to hide and unhide comments in VS2010. What i found is:
# region
comments for code
#endregion
and:
http://holyhoehle.wordpress.com/2010/01/17/hide-comments-in-visual-studio/
but this one is not working in VS2010 or i don't know how to...
So maybe any one can help and offer some solution how to hide comments like:
string x = "...." //comment
this extension is no longer maintained
I made a Visual Studio extension that allows you to hide/show comments.
You can get it here:
for Visual Studio 2010-2013
for Visual Studio 2015-2017
You can highlight them one by one, Right-click, and choose Outlining > Hide Selection.
The keyboard shortcut for that maneuver is Ctrl+M, Ctrl+H.
Aside from setting the font color of the comments to the same as the background color (which is what that VS plugin that you mentioned does), there is no way to hide comments.
Multi line comments (prefixed with either // or /* */ are already collapsible, but single line comments are not natively. Your only option for those is to use the Ctrl-MH key chord for a temporary (while the file is open) collapse (as mentioned in #rfmodulator's answer), or remove them altogether.
*The default C# key chord for collapsing all collapsible blocks is Ctrl-MO
You could use this macro to collapse all of the XML comments. I suspect that's about as good as you're going to get.
There is no way other than changing the comment color to hide inline comments and I could see that leading to all sorts of problems.
To hide the selected code or area (first select the area), just use Ctrl + M, Ctrl + H.
This works for any selection.
Using shortcut keys: Simply select your comment or working code and the just press:
Ctrl+M, Ctrl+H -> To hide (this simply collapse your selected section and make small box preview)
Ctrl+M, Ctrl+U -> To uhide

Categories

Resources