Why does Bunifu controls shows error on this.Close()

223 Views Asked by At

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?

1

There are 1 best solutions below

1
Cyrille Con Morales On BEST ANSWER

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();
}