VB.NET: what does the 'friend' modifier do?

CJ7 picture CJ7 · May 5, 2010 · Viewed 18.5k times · Source

What does the 'friend' modifier do in VB.NET?

Why is it the default modifier for GUI components in Visual Studio?

Answer

Hans Olsson picture Hans Olsson · May 5, 2010

friend in VB.Net is the same as internal in C#, it means that it can be accessed anywhere in the same assembly, but not from other assemblies.

I think it's a sensible default since I would say that normally one assembly should not be using another assembly's GUI controls (unless it's a class library or similar that is built for the purpose).