1

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.

Habibillah
  • 27,347
  • 5
  • 36
  • 56
Boneyards
  • 83
  • 1
  • 2
  • 9
  • Sorry, but I don't understand your question. Try to clarify, explain what is expected, what is actual, what you did, and exact error messages if any. – Steve B Oct 23 '12 at 06:59
  • `public Form();` ?? is it a typo ? this should be `public Form()` I guess – yogi Oct 23 '12 at 07:00
  • Can you tell the complete error? and have a look inside InitializeComponent may be there is still something wrong. – muhammad kashif Oct 23 '12 at 07:01

2 Answers2

9
  1. Remove the semicolon at the end of the first line of the constructor.
  2. Change your class name to something other than "Form".
Amiram Korach
  • 13,056
  • 3
  • 28
  • 30
3

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

Peter Stock
  • 301
  • 1
  • 7
  • InitializeComponent(); Became underlined, and all the void parts of my code are red underlined, and my array names and streamreaders are all underlined. – Boneyards Oct 23 '12 at 07:03