I'm trying to change the topmost of my Main form from the Settings form and it doesnt work. Here is the code:
private void button1_Click(object sender, EventArgs e)
{
if (this.button1.Text == "Top Most: ON")
{
this.button1.Text = "Top Most: OFF";
var main = new Main();
main.TopMost = false;
}
else if (this.button1.Text == "Top Most: OFF")
{
this.button1.Text = "Top Most: ON";
var main = new Main();
main.TopMost = true;
}
}
In the settings form:
And in your main form that shows the settings: