473,805 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3605
I think you can use an attribute to do such a thing

check out

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003 FEB.1033/cpref/html/frlrfSystemComp one
ntModelBrowsabl eAttributeClass Topic.htm

In which case you can set

<BrowseableAttr ibute(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******** *******@TK2MSFT NGP11.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******** *******@TK2MSFT NGP11.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******** *******@TK2MSFT NGP11.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
5193
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 as "active content". :( The idea is that if the user doesn't have JavaScript enabled, they will see an image of the email address (that can't be read by email harvesting programs). If JavaScript is enabled, the image will be hidden and the...
5
1978
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. The exception was "Method Validate in type GSL.Shared.GridFilters.GridFilter from assembly GSL.Shared, Version=1.0.1804.21512, Culture=neutral, PublicKeyToken=null does not have an implementation.".
17
2923
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 when the Poodle is upcast to the Dog (in its wildest dreams) it then says "bow wow" where the bernard always says "woof" (see code). Basically, it appears that I'm hiding the poodle's speak method from everything except the poodle. Why would I...
22
2198
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 stage. One approach I have used on other systems is to prevent the action buttons appearing. For example, if one did not have the Role of Administrator, one would be prevented from deleting a ticket not created by oneself. However, it did occur...
5
3998
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 creating a new instance of the main form when returning to it but than my application is just creating more forms. How do I hide the main form and return back to it when exiting another form?
3
6581
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 foo( char const ) {} };
11
2968
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 it in VB6. In VB2005 I can get a list of all the open forms, but I get an error after hiding the first one. This is what I'm trying to use: For Each m In My.Application.OpenForms
7
1763
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 = False methods. As far as I can tell these methods are available and should work in VB2005. Any help and advise would be great as this is causing be a number of problems of two new projects I am working on. Many Thanks
0
905
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
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.