I have below line of code in my Windows application.
Below is the code which get trigger on click of tray icon click, and NotifyForm is normal Windows form.
ExceptionManager.Process(
() =>
{
if (notifyForm == null)
{
notifyForm = new NotifyForm();
notifyForm.Deactivate += (o, args) =>
{
notifyForm.Close();
};
notifyForm.Disposed += (o, args) =>
{
notifyForm = null;
};
}
if (!notifyForm.Visible)
{
notifyForm.ShowPopup();
}
else
{
notifyForm.Close();
}
}, "Policy");
Form is closing fine, when I run it through Visual Studio, if I navigate to Release folder and run exe explicitly, Deactivate event never fires. Help on this really appreciated.
Just for more information, notifyForm is notification pop up window which shows up above the tray, on click of tray icon.
Also, I have tried running application in release mode through visual studio, and it works fine. Only problem start happening when i run it outside of studio.
I have verified exe is up to date.
Edit - Basically I have form which i open on click of tray icon, and expecting clicking on desktop or some where should trigger deactivate event, which is not happening. Not sure why. :(