Results 1 to 11 of 11

Thread: Copy Form to another project

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    Barrie, Ontario - Canada
    Posts
    85

    Copy Form to another project

    Hi Everybody,

    I seem to be stumped. I want to copy a form from one project to another different project.

    I can move the *.frm and *.frx files to the new project directory, but it will not appear in the Project Explorer.

    What must I do. I don't believe I need to redraw the form... there must be a way to export it to the new project.

    Thank,s
    Paul

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Copy Form to another project

    You have to import the .frm file. On the right of your screen in the project explorer window right click and choose add.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Copy Form to another project

    You have to do Project/Add Form/Existing and then select it. Then it will become a part of your project and show up in the Project Explorer.

  4. #4
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Copy Form to another project

    Yeah Hack's way is easier... just posted what I am used to doing.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Copy Form to another project

    Quote Originally Posted by Besoup
    Yeah Hack's way is easier... just posted what I am used to doing.
    Actually, I think your way is easier....it is less clicking.

    It is just that using the IDE menu is the way I'm used to doing it.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Location
    Barrie, Ontario - Canada
    Posts
    85

    Re: Copy Form to another project

    Thanks Besoup and Hack...

    You've saved what little hair I have left after this. I knew it had to be simple, but I just didn't "see" it.

    Thanks again

    Paul

  7. #7
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Copy Form to another project

    The solution here, is not working for me.
    I have a form in an existing (large) project. It has the IsButton User Control on the form.
    http://www.planet-source-code.com/vb...70247&lngWId=1

    I have started a new project, with just the default Form.
    I have added IsButton.ctl (there is no IsButton.ctx) to the folder (Directory).
    I have re-opened the new project and added the IsButon user control to the Toolbox.
    I have Used the Project Menu 'Add Form' and browsed to the original large folder to add it's form.
    I then get an error, and the button becomes a picturebox.
    Line 280: Class Project1.isButton of control isButtonShowDL was not a loaded control class.
    Line 288: The property name _ExtentX in isButtonShowDL is invalid.
    Line 289: The property name _ExtentY in isButtonShowDL is invalid.
    (There are more of those last two lines property errors)

    I am old.
    Am I confused, or is it not possible to bring the Form across with it's user controls ?
    Rob
    Last edited by Bobbles; May 12th, 2013 at 10:49 PM.

  8. #8
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Copy Form to another project

    Have you tried these alternate steps?

    1. Copy the existing Form and IsButton User Control to a new folder.
    2. Start new Standard EXE project.
    3. Press Ctrl+R to show the Project Explorer window.
    4. Drag and drop the Form and IsButton to the Project Explorer window.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  9. #9
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Copy Form to another project

    Quote Originally Posted by Bonnie West View Post
    Have you tried these alternate steps?

    1. Copy the existing Form and IsButton User Control to a new folder.
    2. Start new Standard EXE project.
    3. Press Ctrl+R to show the Project Explorer window.
    4. Drag and drop the Form and IsButton to the Project Explorer window.
    Thanks for responding Bonnie.
    Still getting same error.

    My Googling has come up with another hit, where I asked the same question years ago.
    I am (still) old, so had forgotten that.
    I am re-visiting that thread, and will give it a bash (again apparently)

    Regards,
    Rob

  10. #10
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: Copy Form to another project

    Yup the solution given years ago, and forgotten by me, works.
    Here is the solution (for future Googlers) -

    frmDefaultCancelProps references isButtonTest.isButton - isButtonTest is the library (the Project Name) and isButton is the class.
    If you add the user control to a new project the Library changes. It would be something like Project1.isButton
    2 choices
    1) change the name of your project to isButtonTest
    2) change all occurrences of isButtonTest in the frm file (using notepad) to the name of the new project before adding the form to the project.
    Last edited by brucevde; Aug 30th, 2006 at 06:50 AM.

    Those Canadians are pretty smart
    (They also produce great Science Fiction TV shows)

    Thanks,
    Rob

  11. #11
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Copy Form to another project

    It is usually pretty quick to copy the FRM & FRX files to the new Project folder, then open the VBP in that folder and use Add File... to select the Form.

    But I agree that any internal UserControl references will require updating of the library qualifier if it isn't the same (Project Title, which defaults to the VBP file's name). And this is best done first, using Notepad or something.

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