Results 1 to 4 of 4

Thread: Make a Copy of a Form During Design Time - VB Express

  1. #1

    Thread Starter
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    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:
    VB Code:
    1. Public Class frmOriginal
    to:
    VB Code:
    1. 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
    Last edited by JazzBass; Nov 8th, 2006 at 03:39 PM.
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

  2. #2
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    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
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width