|
-
Apr 29th, 2017, 11:25 AM
#1
Thread Starter
Fanatic Member
Get rid of automatically filled-in End Sub, End If
I'm using VB.NET 2010 Express Edition Visual Studio editor. Is there any setting that can stop the editor from filling in "End If" and "End Sub". I want to type these in myself.
-
Apr 29th, 2017, 12:04 PM
#2
Re: Get rid of automatically filled-in End Sub, End If
Under tools, Options, Text Editor, Visual Basic, Advanced you should see an option for "Automatically Insert End Constructs" turning that off should do the trick.
-
Apr 29th, 2017, 01:43 PM
#3
Re: Get rid of automatically filled-in End Sub, End If
Why do you want to do this? One of the complaints that has always been lodged against VB (incorrectly, for the most part) is that it is too wordy, and you are asking for a way to be required to type more? I'm totally curious about that.
My usual boring signature: Nothing
 
-
Apr 29th, 2017, 02:03 PM
#4
Re: Get rid of automatically filled-in End Sub, End If
 Originally Posted by Shaggy Hiker
Why do you want to do this? One of the complaints that has always been lodged against VB (incorrectly, for the most part) is that it is too wordy, and you are asking for a way to be required to type more? I'm totally curious about that.
Me too.
-
Apr 29th, 2017, 02:34 PM
#5
Thread Starter
Fanatic Member
Re: Get rid of automatically filled-in End Sub, End If
Thank you, Plausiblydamp. They are a nuisance. They pop up in the wrong place half the time. I'll be glad to control the code myself.
-
Apr 29th, 2017, 07:24 PM
#6
Re: Get rid of automatically filled-in End Sub, End If
 Originally Posted by projecttoday
...They pop up in the wrong place half the time. I'll be glad to control the code myself.
In all the years I have written VB I can't ever recall them popping up in the wrong place. What version are you using?
-
Apr 29th, 2017, 07:40 PM
#7
Re: Get rid of automatically filled-in End Sub, End If
I've got to agree, they always show up 2 lines below the start construct, where else would you want them?
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Apr 30th, 2017, 02:37 AM
#8
Re: Get rid of automatically filled-in End Sub, End If
Usually the case would be where you already had written some code, and decided to put that code in an If block.
You type in the If condition in front of the code you want to block, and when you hit return, it inserts a blank line and End If, and you have to remove those and then go down to where you want them and reinsert.
Likewise, when you are modifying an existing If ... End If block to add more levels inside, or are restructuring the logic, The End If can be inserted for you, but it doesn't belong there because you have existing code you want to block, so you have to remove and reinsert.
Of course you could just get into the habit of hitting down arrow instead of Return, and it shouldn't add the End If for you, but it will usually indent all the following code until if finds an End If (assuming there is one). Sometimes that will throw you off as you have to go down and find the spot where you really want the End If, knowing that the code has been shifted so may not be as recognizable as it was just be for you put in the If.
Sometimes, I'll put the End If in first, at the bottom where I know I want the block to end, then move up and put the If condition in.
While it happens enough to me to be a minor annoyance, it isn't bad enough to make me want to disable the auto End If insertion. I miss the auto insertion during the infrequent times I revisit VB6 programming.
Last edited by passel; Apr 30th, 2017 at 02:47 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|