I have buttons in an options menu that i want to be able to change the style of every form at once. At the moment it only applies to the options menu itself because I've used "this."
private void Fullscreen_toggle_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Normal;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Bounds = Screen.PrimaryScreen.Bounds;
}
private void Windowed_toggle_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
}
Is there some way to make this apply globally?
Iterate over the Application.OpenForms() collection like this: