Results 1 to 2 of 2

Thread: Forms Disappearing Suddenly !

  1. #1
    Join Date
    Oct 2008
    Location
    INDIA
    Beans
    331
    Distro
    Ubuntu 12.04 Precise Pangolin

    Thumbs down Forms Disappearing Suddenly !

    Hello There,

    I am using System.Windows.Forms in Monodevelop C# Programming. The code is given below:

    Code:
    using System;
    using System.Windows.Forms;
    
    class Test
    {
    Public static void Main() {
    Form frm = new Form();
    frm.Show();
    }
    }
    The above code is showing the frm form but it is suddenly disappearing (exiting). Press F5 to run and the form appears and disappears, that's it.

    How can this problem can be solved.
    Controlling complexity is the essence of computer programming. - Brian

  2. #2
    Join Date
    Apr 2009
    Location
    Germany
    Beans
    2,134
    Distro
    Ubuntu Development Release

    Re: Forms Disappearing Suddenly !

    you have no event loop so it will just go out of scope and get destroyed.

    To get it to show do e.g.:
    Code:
    using System;
    using System.Windows.Forms;
    
    class Test
    {
      public static void Main() {
        Application.Run(new Form());
      }
    }

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •