If True Then
End If
Then it highlights the "True" in blue and prompts for a replacement.
In Visual C#.NET, I'm used to typing out the condition and hitting the return key so that I'm brought into the body of the statement.
However, hitting return in VB.NET does not do the same thing at all. What's the shortcut key I could use to tell VB.NET that I'm done typing my condition and ready to start typing the body?
Snippets in VB.NET - quick question
When I type "if" and hit TAB, VB.NET saves me some time and replaces it with this:
I don't know of such a shortcut - however, if you type "if condition<enter>",
the editor will automatically insert "then", move the cursor down and add the "end if" after your text, so with the same ammount of typing as your snippet you'll end up with the cursor on the body of the statement.
Or you could just hit esc to dismiss intellisense, then the down arrow, and end up there anyway.
the editor will automatically insert "then", move the cursor down and add the "end if" after your text, so with the same ammount of typing as your snippet you'll end up with the cursor on the body of the statement.
Or you could just hit esc to dismiss intellisense, then the down arrow, and end up there anyway.
I see, maybe it works a little differently in VB.NET.
In C#, I used to type "if<TAB><TAB>condition<ENTER>".
I guess in VB I could do "if condition<ENTER>", although I was expecting I could do "if<TAB>condition<ENTER>".
In C#, I used to type "if<TAB><TAB>condition<ENTER>".
I guess in VB I could do "if condition<ENTER>", although I was expecting I could do "if<TAB>condition<ENTER>".
But wait...
What about this. When you're inside a class definition, you know how you could type "property<TAB>", and VB.NET fills in the following:
And a bunch of those fields are highlighted. You can hit <TAB> and <SHIFT+TAB> to switch between them, and they all change intelligently (i.e., if you change one of the "String" fields to "Double", the other one does too).
Well, what do you hit when you're done? It doesn't seem to be <ENTER> nor <ESC>.
What about this. When you're inside a class definition, you know how you could type "property<TAB>", and VB.NET fills in the following:
Private newPropertyValue As String Public Property NewProperty() As String Get Return newPropertyValue End Get Set(ByVal value As String) newPropertyValue = value End Set End Property
And a bunch of those fields are highlighted. You can hit <TAB> and <SHIFT+TAB> to switch between them, and they all change intelligently (i.e., if you change one of the "String" fields to "Double", the other one does too).
Well, what do you hit when you're done? It doesn't seem to be <ENTER> nor <ESC>.
I don't think you need to enter anything. just use the cursor keys to move elsewhere and continue coding once you're done modifying the snippets. Ctrl+S (save) might also fully commit the snippet.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement