By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

Hiding references to forms in a VB.NET DLL

P: n/a
Tom
I have a DLL that has a couple of class objects, and a few forms. When
someone uses my DLL (i.e. puts a reference to it in their program), I want
them to see the class objects that are public, but I -DON'T- want them to
see the forms (via intellisense). They should only be able to access the
forms by calling routines in the class libraries which then display the
forms.

What do I need to do to get this to occur? Declare each forms class as
Friend? Or what?

Tom
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I think you can use an attribute to do such a thing

check out

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemCompone
ntModelBrowsableAttributeClassTopic.htm

In which case you can set

<BrowseableAttribute(False)>My FormClass
inherits System.windows.forms.form

And that *should* hide it from intellisense...

-CJ

"Tom" <to*@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a DLL that has a couple of class objects, and a few forms. When
someone uses my DLL (i.e. puts a reference to it in their program), I want
them to see the class objects that are public, but I -DON'T- want them to
see the forms (via intellisense). They should only be able to access the
forms by calling routines in the class libraries which then display the
forms.

What do I need to do to get this to occur? Declare each forms class as
Friend? Or what?

Tom

Nov 20 '05 #2

P: n/a
Nevermind, reading futher I don't know if thats possible.. I would assume an
Attribute could do so, or you could define your own attribute, but I haven't
played with designer stuff like that much...

Delcaring the method private or the class private (or protected with
CannotInherit property) will prevent anyone from ever using it.
"Tom" <to*@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a DLL that has a couple of class objects, and a few forms. When
someone uses my DLL (i.e. puts a reference to it in their program), I want
them to see the class objects that are public, but I -DON'T- want them to
see the forms (via intellisense). They should only be able to access the
forms by calling routines in the class libraries which then display the
forms.

What do I need to do to get this to occur? Declare each forms class as
Friend? Or what?

Tom

Nov 20 '05 #3

P: n/a
Hello,

"Tom" <to*@nospam.com> schrieb:
I have a DLL that has a couple of class objects, and a
few forms. When someone uses my DLL (i.e. puts a
reference to it in their program), I want them to see the
class objects that are public, but I -DON'T- want them to
see the forms (via intellisense). They should only be able
to access the forms by calling routines in the class libraries
which then display the forms.


Don't set the modifier of the forms to 'Public'.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

P: n/a
Tom,
As the others have suggested. Set the forms to Friend.

Friend Class Form1
Inherits ...Form
End Class

Will cause Form1 to only be accessible from within that assembly.

Hope this helps
Jay

"Tom" <to*@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a DLL that has a couple of class objects, and a few forms. When
someone uses my DLL (i.e. puts a reference to it in their program), I want
them to see the class objects that are public, but I -DON'T- want them to
see the forms (via intellisense). They should only be able to access the
forms by calling routines in the class libraries which then display the
forms.

What do I need to do to get this to occur? Declare each forms class as
Friend? Or what?

Tom

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.