I have auto-generated some code for a button by double clicking it.
By default, the code is created with a return type of void and
assigned to a click event. Now, I want the function to return a
DialogResult instead, so I go and replace 'void' with DialogResult in
the function header, but then I get an error stating it's the wrong
return type.
Double clicking the error in Visual Studio takes me to where the
EventHandler is assigned to the click event, but since only asks for
the name of the function and not a return type, I don't see how the
return type can be wrong.
The auto-generated function looked like:
private void button1_Click(object sender, EventArgs e)
I changed it to:
private DialogResult button1_Click(object sender, EventArgs e)
And the error takes me inside the InitializeComponent() function on
the line:
this.button1.Click += new System.EventHandler(this.button1_Click);
What am I doing wrong here?