سؤال

So I was all done with my program and tried to edit a few small things at the top, and started getting errors and can't change them back. Here is the code:

namespace FinalProject
{
    public partial class Form : Form
    {
        public Form();
        {
           InitializeComponent();

        }
    }
}

I changed the Form: Form part and then it made the InitializeComponent(); into an error. Tried to change it back and its still showing the error. Undo is not an option and I'm sure it's an easy fix.

هل كانت مفيدة؟

المحلول

  1. Remove the semicolon at the end of the first line of the constructor.
  2. Change your class name to something other than "Form".

نصائح أخرى

A Class named Form cannot inherit another class also named Form. You have to give it a different name.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top