Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

When I try to delete those empty handlers the form gets broken. How can I remove those annoying codes from my program without affecting form?

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
223 views
Welcome To Ask or Share your Answers For Others

1 Answer

When you delete the btnOrder_Click you should also delete the following line in yourForm.Designer.cs:

this.btnOrder.Click += new System.EventHandler(this.btnOrder_Click);

To find this line after you removed the btnOrder_Click rebuild your project and then in the Error List window double click on error which says:

'WindowsFormsApplication1.Form1' does not contain a definition for 'btnOrder_Click' and no extension method 'btnOrder_Click' accepting a first argument of type 'WindowsFormsApplication1.Form1' could be found (are you missing a using directive or an assembly reference?)

By double clicking on this error you will redirect to that line and after deleting that line your form returns back.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...