Visual Studio 2019 Intellisense replace - c#

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

Related

In visual Studio, when formating automatically, how to reduce block spacing to minimum?

When doing formatting is there an options to control and reduce spaces in blocks ?
You can try the following steps to reduce extra blank lines.
First, please use hot key Ctrl+H to open replace function box.
Second, please select the code you want to format.
Third, please choose Use regular expression and Selection.
Finally, please input (?<=\r\n)\r\n in the find box and click the Replace all.

When the user clicks on an UltraGrid cell that contains multiple lines of text, the selected text loses the CRLFs

I have a C# program that uses an Infragistics UltraWinGrid to display comments. A comment can be multiple lines. That is, it can contain carriage return/line feeds (CRLFs). (See the upper portion of the attached screenshot.) But when the user selects the text of the comment by clicking on the cell, it loses the CRLFs. (See lower portion.) This is a problem, because comments can be very long and the user may want to copy and paste a comment somewhere else without losing the formatting.
From what I understand, this problem results because the grid uses a Windows textbox as an editor when the user clicks on a cell. Is there some way that I can either make the textbox keep the CLRFs or replace the textbox with an editor that does? Thanks.
Turns out there are a few stars that need to align for this.
Of course CellMultiLine needs to be set for the column like wnvko pointed out.
But also, you must make sure your Column Style is NOT FormattedText or FormattedTextEdit. (If that's required for editing i think you are out of luck). Just use Default style.
And finally make sure you CRLFs are actually truly CRLFs. My best suggestion is to use Environment.NewLine. If you are pulling the data from the DB, make sure you use CHAR(13) + CHAR(10) in that specific order. See Differences Between vbLf, vbCrLf & vbCr Constants
Hope this helps 4 years later. :-) But wanted to share for others since i found no solution elsewhere.
My suggestion is to use Templates. Have a look at the official Infragistics UltraWebGrid help book that is explaining in depth how to configure features like Row and Column Templates.
Go to page 74 for more information regarding the templating.
You should set CellMultiLine of the column to True. Here is how it is working when I set it in my grid
I never found a real answer to this question, but I was able to do a workaround by capturing the click event and having it open a small dialog box containing the cell text. I had the dialog box open at the point the user clicked, so that it appeared over the cell. After a few minor adjustments to take care of border conditions, it worked surprisingly well, so I'm calling this one solved. Thanks, everyone, for your suggestions.

Underline first letter in CheckBox

I have a c# form and when I put CheckBox and set text to Text&Input. 'I' should be underlined but it is underlined only when I hold ALT. Any idea how to fix it?
Put an & character in front of the character that should be the shortcut. Like
chk.Label = "&Text";
As for the actual underlining, Windows has an option to hide underlining by default until you press the ALT key.
This link may be useful in turning it on, but then this is not a programming question but a UI question.
http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/where-is-hide-underlined-letters-for-keyboard/17e253e4-3802-46d1-99d1-6563574dabe8
Note that this also applies to Windows 8.1.

Why does Resharper intellisense replace my code?

With Resharper 6.1, when I type something like...
widget.PropertyA
and then put my cursor in front of the widget symbol like this...
|widget.PropertyA
and start typing another symbol, R# intellisense pops up. If I choose a suggested symbol, then R# replaces the widget symbol with my newly chosen symbol.
I can see how this might be useful at times, but the vast majority of the time, I just want to type more code in front of widget and don't want it to be replaced. Does anyone know if this behavior is configurable?
Thanks.
I don't believe it is configurable. It seems to be by design that Tab overwrites code. It will even highlight the segment of code that would be replaced.
Instead of hitting Tab to select your symbol, use Enter instead. It will insert the new code without overwriting the existing code.
Go to IntelliSense -> Completing Characters in your ReSharper options. At the top of that menu you can whether the Enter and Tab keys insert or replace.
The only thing you can really do is to insert an extra space before you start typing. You could request that it be changed on JetBrains' bug tracker. Let me know if you do and I'll vote for it!

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