.net – How to hide methods/properties of the class-library (dll) from Visual Studio’s IntelliSense

.netvb.net

I am writing my first class-library in VB.NET. My idea is to distribute this library so others may use it in their applications.

However, perhaps due to my lack of experience in writing and structuring the library and the classes therein, I noted that the methods/properties are ALL being shown in the IntelliSense of Visual Studio.

The thing is that many of them are only used within the library itself and should NOT be used by the developers (could create a disaster) when they incorporate my library in their application – only a few should be visibile i.e. the ones which are needed by the developer.

Thus, my question is: is there a way to hide certain methods/properties of my library from Visual Studio's IntelliSense? Maybe something similar to REM?

Thanks in advance.

EDIT: as mentioned – this is my first library and I now understand that my question could be intepreted in two ways:

1) how to hide something from IntelliSense

2) how to prevent a developer from using and calling certain methods/properties

Of course, the end-result that I want is that the developer is not able to access AT ALL certain methods/properties i.e. No. 2 above.

Many thanks. I just learnt something new today and I will now study Access Levels…

Best Solution

Only the types/methods/properties you want to be visible should be declared Public. The rest should be declared Private, Protected, Friend or Protected Friend.

You can read more about these access levels on the MSDN web page for them. In general you should usually only make things as public as they really need to be.