Click here to Skip to main content
15,881,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I have a Form, it is just like an Input Box but it has a Keypress Validation function (allow numeric, alpha or alphanumeric with character exceptions [eg. allow space comma period etc]). This form is always used in almost all of my projects, copy and pasting it to my new solution. I have a User Control a Simple Image Viewer and coded some useful functions in it (PDF to Tiff, Merge Images to Tiff, Connection to Different Databases, etc). Is it possible to make the Form as a User Control, just like an Open/SaveFileDialog. If it is, can someone give me a hint how to do that

Thanks...
Posted
Updated 29-Apr-14 22:00pm
v3
Comments
Rage 24-Apr-14 8:08am    
What you want to achieve is not really clear, can you elaborate a bit ?
hansoctantan 25-Apr-14 2:44am    
I want the Form to be used as a User Control or anything as long as I will not add existing item to my new project

Now I'm using that process, creating new project then copy it to the solutions location and add the form

It will be helpful if I can put it in my own reference, which I already have

1 solution

You can make a user control for GUI and Use a common shared Form which contains your user control with which you can use it in Multiple modules.

This can be done as follows

Right click Project
Add->Existing Item->Add as link(Select your form and right click)


This will share your form in multiple modules


Or another way is to use the form as DLL and Add it as reference for your project
 
Share this answer
 
Comments
Tino Fourie 24-Apr-14 18:08pm    
It sounds like you need to build a library instead of a user control to not only be implemented in all your project but also to maintain it in a proper manner.

Sreeyush touched on this when he mentioned to use it as a DLL in your project.

Another important aspect of a collection of functionality it to have as many of them as a function. In its current form, as User Control, it sounds more like most of the functionality is issued on controls contained in the user control therefore your code is only limited to that control for as long as it lives.

Also, a user control is there to create a new control which could either be an improvement of an existing control,an entirely new type of control or just a collection of commonly used controls in a single container. The user control has a specific purpose compared to that of a library which is a collection of various functions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900