According to MSDN:
Public access is the normal level for a programming element when you
do not need to limit access to it. Note that the access level of an
element declared within an interface, module, class, or structure
defaults to Public if you do not declare it otherwise.
So, if I declare a class method in VB.NET without specifying an access modifier, then it is public by default:
Sub DoSomething()
End Sub
This is insane! I want members to be private by default, and only those specifically marked as Public to be visible outside the class. Like in C#… How do I modify this behaviour?
As Fredrik has already commented, you should always provide explicit access modifiers.
I assume that this is due to downwards compatibility or developers who are not familiar with access modifiers at all.
But you are right, as in C# I would suggest to make everything as private as possible by default. You can make it more public when needed.
Declaration Contexts and Default Access Levels (VB.NET)
I don’t think that it’s possible to specify the default access modifier somewhere in Visual Studio. You could try to create a template-class which is suggested here (not tested):
Visual C# 2010 Express: Specify default access modifier for new classes?