473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hiding references to forms in a VB.NET DLL

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
4 3589
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
5
by: Andrew Baker | last post by:
If you have every had the following error when trying to use load a form in the IDE then read on!!! An exception occurred while trying to create an instance of GSL.Windows.Forms.BrowserFormBase....
17
by: Bob Weiner | last post by:
What is the purpose of hiding intead of overriding a method? I have googled the question but haven't found anything that makes any sense of it. In the code below, the only difference is that...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
5
by: Ivan | last post by:
I am used to VB6 and am not sure how to do this in Vstudio .NET. I have a main form which calls other forms. I want to disable that main form while other ones are called. I tried hiding it and...
3
by: Nicolas Castagne | last post by:
Hi all, I have been wondering for a while why function hiding (in a derived class) exists in C++, e.g. why when writing class Base { void foo( int ) {} }; class Derived: public Base { void...
11
by: Kevin | last post by:
I've got a timer on my MDI parent form. If there's no mouse movement for a set number of minutes, the Visible property of all open forms is set to False and the Log On form is displayed. I could do...
7
by: Steve954 | last post by:
I recently installed and started using VS2005 on a Windows XP Pro machine. When creating a new windows forms project I find that I am unable to hide any forms using the me.hide() or me.visible =...
0
by: Jordi Rico | last post by:
Hi, I have an MDI Form which shows maximized mdi chil forms. I don't want these forms to show its own icon, and I am not able to hide it... Is there any way of hiding my forms icons??? Thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.