Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inheritance + Modifiers of controls 2

Status
Not open for further replies.

VBakias

MIS
May 24, 2005
219
GR
Hi,

I have not found yet the correct documentation, so i post my question here. The default value of the "modifiers" of e.g a button is "friend". There is an option of Public, Protected, Private, etc...

I open a class project, remove the class.vb file and add a windows form. I make the layout and then build the dll (ClassLibrary1, Form1).

In a new project, windows application, I do not you the default Inheritance but: Inherits ClassLibrary1.Form1
I cannot have access to the button in the dll, unless i change the modifiers in the dll to e.g Public.

The point of that post is to learn what's the scope from these modifiers to the controls applied.

- Public
- Protected
- Protected Friend
- Friend
- Public

Tnx!
 
Private - Available only from within the class
Friend - Available from within the assembly
Protected - Available from any classes that inherit this class
Protected Friend - Available to any classes that inherit this class and are in the same assembly
Public - Available to everything

-Rick


VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Errr this might sound to you as a stupid-silly question, but what do you mean with the word assembly ? (to be in the same assembly)

(English is not my native language)
 
An assembly is the .EXE or .DLL produced by the .NET compiler. Note these are different from their Win32 counterparts in that they contain MSIL (Microsoft Intermediate Language) code as opposed to directly executable code.

Hope this helps.
 
The default value of the modifiers' readonly property of the controls is "Friend - (Available from within the assembly)".
So this makes sense now for being the default value!

Thanks earthandfire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top