0

When I minimze form while running in Visual Studio, everything works fine - form is hidden and restored to previous FormWindowState.

However, when running outside of the IDE, suddenly form starts closing. I attached to running process, however I wasn't able to determine cause of this.

Edit: Cancelling form closing within FormClosing event doesn't even prevent form from closing when I minimalize form.

Update: It seems that hiding form causes closing it. Beacuse, if I don't hide form when user minimizes it, it won't close.

This is much more weird, since in IDE it works as expected.

mnn
  • 1,952
  • 4
  • 28
  • 51
  • It might be due to the process to which you attached. Check that out – Aishwarya Shiva Mar 18 '12 at 17:28
  • Use the debugger. Write a FormClosing event handler and call System.Diagnostics.Debugger.Launch(). Or use Tools + Attach to Process and set a breakpoint in the event handler. – Hans Passant Mar 18 '12 at 18:28
  • Well that doesn't help, since I already tried putting breakpoint inside FormClosing event. That didn't give me any clue why the form started closing. – mnn Mar 18 '12 at 18:44

0 Answers0