문제

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