Intellisense and Friend
Matías asked this question:
I have written a program library with a whole structure of classes. When I use the library in another project, all of the classes can be selected.
How can I code the library so that only one class shows up in Intellisense.
----------
Great question, Matías. That's what access modifiers are for. You mentioned that you tried one of them: "Private" but then the program wouldn't work. The one you want is "Friend." The documentation for "Friend" states:
In many cases, you want programming elements such as classes and structures to be used by the entire assembly, not only by the component that declares them. However, you might not want them to be accessible by code outside the assembly, for example if the application is proprietary. If you want to limit access to an element in this way, you can declare it with Friend.
That way, you get this result in Intellisense:



Comments
No comments yet. Leave a Comment