Windows Form Applications Run Without Stopping

I am brand new with C#, so bear with me and don't laugh...

I am working through Microsoft's book for C#. The second exercise is to create a very basic Windows form application. After it was completed, and I click "Start Without Debugging", it worked fine.

However, after the first time, if I try to run the little application, the form pops up, and then immediately disappears.

I loaded some of the other supplied form type applications and they all do the same thing.

This has to be simple. Any ideas



Answer this question

Windows Form Applications Run Without Stopping

  • Troy Lundin

    Have you possibly accidently checked the "Hide" option on the form, to have it minimized, or hidden

  • Raybritton

    I've tried running pre-written, supplied code with the same result. The problem isn't with the code, but I don't know where to start looking.
  • RayCan

    I've tried running a few of the applications that come with the Microsoft Press book. They all do the same thing. I don't think it's a mistake I've made - unless I've changed something in a setting for VS2005 itself.
  • Pat J

    Do you see your source code with a bright yellow line



  • glenrm

    this type of behavior could arise when your Form object leave the scope of visibility. if you use console application type of project you should wait in the main thread for the form to complete. consider this example

    MyForm form = new MyForm();

    Console.ReadLine();

    or try to create new Windows Form project


  • Windows Form Applications Run Without Stopping