By the looks of it you might have renamed the Form1
class at some point or you have tried to copy and rename it to or from AlertDetails
..
Your Form UI code is in a separate file from the main Form
class, so you have to make sure that the class names match and is marked partial class Your_Form_Name
in both/all files.
So lets assume your structure use to look like this:

Form1.cs (1) is a .cs file on its own, but it is only one part of the complete Form1
class.
In that file your class is defined like this: public partial class Form1 : Form
Form1.Designer.cs (2) is also a .cs file on its own, but it also forms part of the Form1
class.
The designer file defines the class like this: partial class Form1
.
If you intended to rename Form1
to AlertDetails
, you have to make sure that the class name is the same in both .cs files, Form1.Designer.cs and Form1.cs
So it should be
public partial class AlertDetails : Form
in the Form1.cs file
- and
partial class AlertDetails
in the Form1.Designer.cs file
AlertDetails
type contained inside the same code file. Try moving it afterForm1
code.