Re: How to make a form of main application reuseable by others?



Pucca,

You can definitely include a form in a class library. A form is nothing
more than a class. All you have to do is make sure the form is public. You
might want to consider whether or not there are menus on the form, if it is
used as a child form, then it will not take to nicely, depending on how
menus on the parent form are used.

All you have to do is create a "Class Library" project and then you can
add your form code to it, and then reference it from other applications.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx


"Pucca" <Pucca@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BC86FAB9-553A-4E23-8DCD-7355CDA456CC@xxxxxxxxxxxxxxxx
Hi, I'm using vs2005, .net 2.0, Win2k server for a Windows applcaiton. I
have a main application where there is a a form and the codes that I would
like to make it reuseable by other applications.
1. I already have a classlibray project but I don't think I can include
a
"form" in it, right?
2. So, do I make this form into a dll so other application can include it
as a reference?
3. To do the item 2, does that mean that I would create a new project and
add the form and the code in it. But how to specify to generate a dll
instead of a project that produce .exe file after it's compiled?
Thank you.
--
Thanks.


.



Relevant Pages

  • Re: Good way to "bundle" shared class code
    ... them between the two, and possibly future, applications. ... reference the DLL from the applications? ... You can do that by selecting the option to reference the file only instead of copying in the dialog used to add a file to the project. ... The drawback is that changes have to be very carefully thought out while the advantage is that you only have a single file to distribute. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sharing Code
    ... If I add a reference to the DLL from my applications running on my desktop, then there is no need to make multiple copies of the DLL. ... then how specifically are you planning to "set a reference" outside of Visual Studio. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Windows Form to dll
    ... I created a windows form, and I want to use it on other applications. ... To create a dll just change the output type in the project properties to ... To use the Forms in another project add a reference to your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sharing Code
    ... If I add a reference to the DLL from my applications running on my ... "set a reference" outside of Visual Studio. ...
    (microsoft.public.dotnet.languages.csharp)
  • VB FAQs (Interview Questions) lot lot
    ... Consider two objects, A and B. A holds a reference to B, ... Why do so many example programs not use the DLL name ... Private Declare Function SendMessage Lib "user32" ... Private Const BUFFER_LENGTH As Long = 255 ...
    (microsoft.public.dotnet.languages.vb)

Quantcast