I need to change the opacity of the main form every time the user clicks the close button. When it clicks on this button the opacity stays in this.Opacity = .75;
and opens a new form asking if it wants to close the program.
Close button on main form:
private void btFechar_Click(object sender, EventArgs e)
{
this.Opacity = .75;
fechar f = new fechar();
f.ShowDialog();
f.Dispose();
}
The problem is that when the user clicks to close the system in the form "close" the opacity of the main form does not return to this.Opacity = 1;
Do not close the program:
public void btFecharNAO_Click(object sender, EventArgs e)
{
principal p = new principal();
p.Opacity = 1;
this.Close();
}