Results 1 to 4 of 4

Thread: Closing a form

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Closing a form

    How can I close a form, which has my start point in it, without the application closing?
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I believe you can't (haven't checked this yet).

  3. #3
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552

  4. #4
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    just converted the inspired by dynamic_sysop code.

    frmMain
    PHP Code:
          static void Main()
          {
             
    frmMain f=new frmMain();
             
    f.Show();
             
    Application.Run();
          }

          private 
    void button1_Click(object senderSystem.EventArgs e)
          {
             
    frmIDontKnow f=new frmIDontKnow(this);
             
    f.Show();
          }

          private 
    void frmMain_Closing(object senderSystem.ComponentModel.CancelEventArgs e)
          {
             
    Application.Exit();
          } 
    frmIDontKnow
    PHP Code:
          Form f;
            public 
    frmIDontKnow(Form f)
            {
                
    //
                // Required for Windows Form Designer support
                //
                
    InitializeComponent();

             
    this.f=f;

                
    //
                // TODO: Add any constructor code after InitializeComponent call
                //
            
    }

          private 
    void button1_Click(object senderSystem.EventArgs e)
          {
             
    f.Close();
          }

          private 
    void frmIDontKnow_Closing(object senderSystem.ComponentModel.CancelEventArgs e)
          {
             
    Application.Exit();
          } 
    hope this helps. if not, sorry.
    Last edited by brown monkey; Jul 15th, 2004 at 08:53 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width