Make a Copy of a Form During Design Time - VB Express
Hi all,
I have a form that has the controls and code I need and is working fine, but I was hoping to develop a more 'Wizard' type.
What I want to do is copy the existing form and name it something appropriate so I still have the original, and can work on the new one.
I do a File - Save As and save a copy of the form that way, but when I add the original back into my project, I get a bunch of errors saying that 'something-something has already been declared', etc...
How can I do what I'm asking for?
Thanks,
JB
Update
Well, I think I figured it out. You do the File - Save As and then view the code behind the newly renamed form and you need to manually change the line:
to:
VB Code:
Public Class frmCopyofOriginal
Then at that point, you can add the original form back into the project and not get any errors.
Is there a more 'automatic' way of doing this?
Thanks again,
JB
Re: Make a Copy of a Form During Design Time - VB Express
I just recently used the GN Wizard Framework to make a wizard style interface with a program I made. Its simple to use, and theres a sample application along with the dll. Its a 1.1 or 1.0 version of the dll, but you can open the solution in 2005 and run the conversion that will pull up, and all should convert fine without problems. Then you can just rebuild the project to make a 2.0 dll. Basically you just put a wizard control on the form, and add wizard pages to the collection with a few button clicks in the designer.
As far as your question goes, theres also Inherited forms you could add, which would create a new form based on the form you decide to inherit from. The new inherited form would contain the controls on the form you inherited from, and any changes to the controls of the form you inherited from would be changed in all forms that are inherited by it. Or, you could just select all the controls on one form you wish to have on the subsequent forms and just paste them into a new blank form. Note that both of these methods won't copy any code that existed in the original form.
Re: Make a Copy of a Form During Design Time - VB Express
Using Inherited forms is probably a good way to go as you create one base form and all your other forms are based upon that one form. You can override the base form to make that particular form unique as to give the appearance of a wizard style application.
Re: Make a Copy of a Form During Design Time - VB Express
RobDog and gigemboy,
Thanks very much for the responses. I must admit I'm not too familiar with Inherited forms, but am willing to try it out.
The GN Wizard interface looks awesome too! I may try that as well.
Thanks very much!
JB