1

Goal:

I have a simple goal, close the form.

Code:

This is Bunifu button:

enter image description here

private void cancelBtn_Click(object sender, EventArgs e)
{
    this.Close();
}

This is normal button:

enter image description here

private void normal_Click(object sender, EventArgs e)
{
    this.Close();
}

Detail:

This is what happens when clicking the normal button:

Form closes without errors.

Whereas, clicking the buniful button shows me this error:

enter image description here

Question:

Why does the Bunifu button throws me this error? I have not got a clue to what the error means. How can it be fixed?

Eduards
  • 1,734
  • 2
  • 12
  • 37

1 Answers1

2

I think that happens because bunifu buttons have some methods after closing the form like change color on hover etc.

You may try this below codes

private void bunifuFlatButton1_Click(object sender, EventArgs e)
{
bunifuFlatButton1.Enabled = false;
this.Close();
}
Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21