由于我的代码错误,visual c#无法加载表单!

visual c# can not load form due to error in my code! LoginDB.Designer.cs

有一个错误是说this.Load += new System.EventHandler(this.LoginDB_Load);

错误是

0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
namespace wavemaker
{
    partial class LoginDB
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btn_Submit = new System.Windows.Forms.Button();
            this.txt_UserName = new System.Windows.Forms.TextBox();
            this.txt_Password = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btn_Submit
            //
            this.btn_Submit.Location = new System.Drawing.Point(197, 60);
            this.btn_Submit.Name ="btn_Submit";
            this.btn_Submit.Size = new System.Drawing.Size(64, 25);
            this.btn_Submit.TabIndex = 0;
            this.btn_Submit.Text ="Login";
            this.btn_Submit.UseVisualStyleBackColor = true;
            //
            // txt_UserName
            //
            this.txt_UserName.Location = new System.Drawing.Point(67, 8);
            this.txt_UserName.Name ="txt_UserName";
            this.txt_UserName.Size = new System.Drawing.Size(194, 20);
            this.txt_UserName.TabIndex = 1;
            //
            // txt_Password
            //
            this.txt_Password.Location = new System.Drawing.Point(67, 34);
            this.txt_Password.Name ="txt_Password";
            this.txt_Password.Size = new System.Drawing.Size(194, 20);
            this.txt_Password.TabIndex = 2;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(6, 11);
            this.label1.Name ="label1";
            this.label1.Size = new System.Drawing.Size(55, 13);
            this.label1.TabIndex = 3;
            this.label1.Text ="Username";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(6, 37);
            this.label2.Name ="label2";
            this.label2.Size = new System.Drawing.Size(53, 13);
            this.label2.TabIndex = 4;
            this.label2.Text ="Password";
            //
            // LoginDB
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(273, 97);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.txt_Password);
            this.Controls.Add(this.txt_UserName);
            this.Controls.Add(this.btn_Submit);
            this.Name ="LoginDB";
            this.Text ="LoginDB";
            this.Load += new System.EventHandler(this.LoginDB_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btn_Submit;
        private System.Windows.Forms.TextBox txt_UserName;
        private System.Windows.Forms.TextBox txt_Password;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
    }
}


删除此行:

1
this.Load += new System.EventHandler(this.LoginDB_Load);

然后双击控件"logindb"创建另一个。