


I would approach it by mental separation in the way that Form1.cs is 100% my responsibility and that on the other hand I'm not touching the code in at all. But if I'm using reset within Properties->Events for the Click-event from within the designer even the label1_Click method in Form1.cs will be removed.ġ.) Isn't that a little inconsistent behavior?Ģ.) What is the recommended way of removing such generated event handler-code?ģ.) What is the best "mental approach"/best practice for using the designer? If I now remove the label only the code within will be removed but the label1_Click method will stay within Form1.cs even if it isn't used by anything else. += new System.EventHandler(this.label1_Click) Īnd it adds the event handler method to Form1.cs private void label1_Click(object sender, EventArgs e) Then with the double-click it will add the event handler label1_Click to the label within, using the following code The designer generates code within (assume default names for simplicity) to add the label,.When we for instance add a label to a form and then double-click on it in the Visual C# designer (I'm using Microsoft Visual C# 2008 Express Edition), the following things happen: I'm new to the Visual C# designer so these are general and pretty basic question on how to work with the designer.
