DeveloperLV
DeveloperLV

Reputation: 1781

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

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?

Upvotes: 1

Views: 240

Answers (1)

Cyrille Con Morales
Cyrille Con Morales

Reputation: 967

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

Upvotes: 2

Related Questions