dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: C# WiinForm Application

  1. #1
    Join Date
    Jun 2016
    Posts
    8

    C# WiinForm Application

    I am creating an application to record and evaluate aerobatic maneuvers using WinForms. My plan is to work with each of the forms that will eventually make up the project independently and then combine them in a single project with controls to switch between the forms. Individual forms will be complicated enough (data collection, data analysis, scoring, OpenGL display of aircraft maneuver, etc) that I'd like to work on them separately. I know how to switch between forms in a project, Formb F1=new Formb();, F1.Show();, this.Hide(); I can add as many forms as I want to a project by selecting the project and add windows form. When you do this the added form is give a unique name. However when I create a standalone project to develop the code for a particular form, the form name is always Form1. If I've read several articles on how to add this form to a project and it's not completely clear to me how to do this. In addition if I add this form to an existing form there will be two Form1 forms in the project. I have two questions:

    1. What is the best way to copy an existing form into an existing project?
    2. How do you get around the duplicate Form1 names for the base form in the existing project and the added form?

    Thanks for any help,

    Andy

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,730

    Re: C# WiinForm Application

    Why not ask the c# question in the c# forum here http://forums.codeguru.com/forumdisp...rp-Programming

    [moderator would you please move]
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.1.6)

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,011

    Re: C# WiinForm Application

    Quote Originally Posted by andycruce View Post
    1. What is the best way to copy an existing form into an existing project?
    In windows explorer, just copy the form1.cs and form1.designer.cs in the directory of the new project. Then in the solution explorer, right click on the project and choose, "add existing item" and choose the new files.
    Quote Originally Posted by andycruce View Post
    How do you get around the duplicate Form1 names for the base form in the existing project and the added form?
    When you choose, "add new item" and choose a form, rename the file before pressing ok - it will also rename the class name of the form.
    Last edited by Arjay; July 24th, 2016 at 09:01 AM.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)