I am really bad at explaining, but what I want to do is make it so my program closes once it detects that another program closes.
I was thinking making a while statement, like:
Process thisProc = Process.GetCurrentProcess();
while(IsProcessOpen("chrome.exe") == false)
this.Close();
but then I notice that it was a "while", not something that detects once it happens, it executes the code once, and the code above would execute it while my chrome is closed.
I also want to know how to open chrome when this is open when something is selected, such as
while(button4.Backcolor == Color.Lime); --acts like a checkbox
Process.Start("Chrome.exe");
However, I do not want the Backcolor to change to red once Chrome opens Also, this method will keep opening chrome while the backcolor is lime(acts as a signal)