This is my current code which takes the bool variable from the settings (checkbox checked or unchecked) and then sets the TopMost property for my application.
namespace POC_App
{
public partial class mnView : Form
{
public mnView()
{
InitializeComponent();
// Start program minimized if setting is set to true
if (Properties.Settings.Default.setting_startmini)
{
this.Visible = false;
if (this.WindowState == FormWindowState.Normal)
{
this.WindowState = FormWindowState.Minimized;
}
this.ShowInTaskbar = false;
}
// Make the program on top
if (Properties.Settings.Default.setting_alwaystop)
{
this.TopMost = true;
}
}
}
}
The problem is that it will make my application stay on top of all other windows, but I have to restart the application every time I check or uncheck the box. What do I do to get it so I don't have to restart the application every time I set the bool setting?