How to make a form private

  • Thread starter Thread starter Mark Hollander
  • Start date Start date
M

Mark Hollander

Hi All,

I am writing a class that will use a form in a library. I would like to hide
the form from the developers but have my class visible, which will use the
form internally.

Is there a way to do it, and if so how do I go about it.

Thank you
Mark Hollander
 
Mark Hollander said:
I am writing a class that will use a form in a library. I would like to
hide
the form from the developers but have my class visible, which will use the
form internally.

Set the form's access modifier to a value other than 'Public'. You can do
that via the properties window ('(Modifiers)' property).
 
if you only want it available withing the project, then instead of
Public Class MyForm

Friend Class MyForm

or you can add a Friend Sub New() to the Form Class, then it is visaible
outside the project but can only be instanciated from within your project
 
I cannot seem to find the property you are talking about, The interface has
changed some what in 2008. I cannot seem to find the forms generated code to
modify it in the underlying source code
--
Thank you
Mark Hollander
VB.NET Newbie (For the moment)
 
I cannot seem to find the property you are talking about, The interface has
changed some what in 2008. I cannot seem to find the forms generated code to
modify it in the underlying source code
--
Thank you
Mark Hollander
VB.NET Newbie (For the moment)

Set the form's access modifier to a value other than 'Public'. You can do
that via the properties window ('(Modifiers)' property).

I'm guessing there is still a "Show all Files" button you must click
first. Besides that you could do it the "dirty" way: Go to the code
behind and change that modifier (Public Partial Class Form1) to
private / friend. Then just double-click the error that appears and it
should take you to the designer generated code.

Thanks,

Seth Rowe [MVP]
 
Thanks to everyone that responded to this thread it was helpfull
--
Thank you
Mark Hollander
VB.NET Newbie (For the moment)
 
Back
Top