locked
Visual Studio | Adding an Additional Form is Inherited Instead of Blank? RRS feed

  • Question

  • Hello,

    After creating a C# Windows Form Desktop Application and getting it working good I decided to add an additional blank form for the help file. When adding the new blank form it always inheritance from the original form, or at least it looks like it does. Created a new project and all the new forms that are created are blank so it looks to be something with my project for some reason. Been trying to figure this out for too long and need help, any suggestions?

    PS: Added this question on StackOverflow and immediately was downvoted and closed with a bunch of nasty comments.  Delete my account there and came here.  Hopefully this place is more friendly.

    PS2: I had a couple of nice screenshots showing what has happened but cannot add them on here:

    • Body text cannot contain images or links until we are able to verify your account.


    Saturday, November 14, 2020 6:31 PM

All replies

  • Take a look at the class that defines the form and see what is written in the inheritance. I'd expect something like this:

    pubic class Form1 : Form

    Then, click on the parent class ("Form") and press F12 to "Go to definition", and see where it leads you. My suspicion is that you may have defined in your project a form that is named "Form". This overwrites the "Form" in the Windows Forms DLLs (which is the blank one), and therefore your Form1 does not appear blank, but rather inherits from that form that you called Form.

    • Proposed as answer by BonnieBMVP Saturday, November 14, 2020 11:59 PM
    Saturday, November 14, 2020 9:37 PM
  • Hi JohnADaniels,

    Thank you for posting here.

    You can verify your account in this link:

    Verify Accounts 43

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 16, 2020 3:12 AM
  • Hi,

    Has your issue been resolved?

    If so, please click on the "Mark as answer" option of the reply that solved your question, so that it will help other members to find the solution quickly if they face a similar issue. If you still have questions, please feel free to ask.

    Best Regards,

    Timon


    "Visual C#" forum will be migrating to a new home on Microsoft Q&A ! We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A ! For more information, please refer to the sticky post.

    Thursday, November 26, 2020 9:29 AM