15

Apologies upfront if this is a silly question, but it's annoying me to no end and I can't figure it out.

I'm using Visual Studio 2013 Professional, and I usually code in C# where when using the Intellisense, when I press Enter to select a method or something it adds my selection and I can continue typing on the same line.

But at the moment I'm working on a project which is in VB.NET, and when I use the Intellisense in the same way it puts my cursor in the next line, i.e. I press Enter to select whatever, it adds my selection and starts a new line, so I have to press the Backspace to go back to the previous line. It's so annoying!

Is there a way to change this behaviour so the cursor doesn't go to the next line? I've looked at the settings available in Tools > Options but can't figure it out, and searching Google for anything similar hasn't been successful.

arie
  • 782
  • 3
  • 13
  • 31
  • Does it also jump to the next line whenever you press `TAB` instead of `Enter`? – Jevgeni Geurtsen May 28 '14 at 10:49
  • Pressing TAB does keep the cursor on the same line. I didn't know I could use that, thanks! But still is there a way to keep it on the same line when pressing Enter? I'm so used to pressing Enter *sigh* – arie May 28 '14 at 10:54
  • 1
    Tab or Space, if you know you need a space. or whatever other character like open bracket (, etc.. or a '.' dot. VB intellisense is better than c# imo. – porkchop May 28 '14 at 12:04
  • 3
    The TAB key is the proper one for autocompletion, you just got too used to using the wrong key. The Enter key is rather a big deal in Visual Basic, it enters the statement completion character. Roughly similar to a ; semi-colon in C#. You'll have to retrain your muscle-memory, it will only hurt for a week or so. – Hans Passant May 28 '14 at 13:54
  • As of Visual Studio 2015 Update 3 RC, there is still no support for this. Under **Options** > **Text Editor** > **C#** > **IntelliSense**, there is an option to change the behavior for using `Enter` in the selection of a suggestion in a completion list. However, this option is missing for **Basic** (Visual Basic) settings. – srbrills Jun 13 '16 at 15:14
  • I had the same problem. Previously i had been using C# and XAML, which had no problems. As soon as i start a project in VB I encounter this problem... – Aric Aug 15 '16 at 15:40

3 Answers3

10

Found it here (paragraph List Members)

You have toggled to suggestion mode instead of completion mode.

You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode.

So, either use TAB/SPACEBAR (as I said in the comment) or press CTRL+ALT+SPACEBAR to switch back to completion mode.

EDIT: I've found out that whenever you type Stri (String will show highlighted in the list now) and you press . (dot) it will autocomplete and stay at the same line.

I think your way of doing this in C# isn't possible in Visual Basic.

Jevgeni Geurtsen
  • 3,133
  • 4
  • 17
  • 35
  • That doesn't seem to be it :( I am in Completion mode, and it does complete the text when I press enter but it also goes to a new line. When I switch to Suggestion mode it goes to a new line without completing the text. – arie May 28 '14 at 11:02
  • I haven't found any answers to this, I couldn't find anything so I just don't think its possible. Although I found something new and I've added it to my main answer. – Jevgeni Geurtsen May 28 '14 at 11:15
  • Oh thanks, that will be helpful too and I think I can get used to it! Something else I found is that instead of pressing Enter I press Space, it completes the word and stays on the same line, maybe that will be easier than using the TAB. – arie May 28 '14 at 11:28
  • Awesome, I'll add it to the answer! – Jevgeni Geurtsen May 28 '14 at 11:32
  • As of Visual Studio 2015 Update 3 RC, there is still no support for this. Under **Options** > **Text Editor** > **C#** > **IntelliSense**, there is an option to change the behavior for using `Enter` in the selection of a suggestion in a completion list. However, this option is missing for **Basic** (Visual Basic) settings. – srbrills Jun 13 '16 at 15:13
0

I had the same problem and discovered that Auto list members was not enabled on my machine. It's under Tools > Options > Text Editor > Basic > General. This gave me the intellisense I was looking for.

6dev6il6
  • 767
  • 2
  • 15
  • 34
Linden
  • 3
  • 1
0

Simple thing which can be used when you face this kind of issue is to press tab key instead of Enter key when the IntelliSense provided me prediction list.

mx0
  • 6,445
  • 12
  • 49
  • 54
Rahul N P
  • 1
  • 3