auto application close

User Generated

nfuhgbfu

Programming

Description

code of auto application close in win form application in visual studio 2010

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

using System;
using System.Windows.Forms;
using System.Drawing;

class TestClass
  {
  static void Main(string[] args)
  {
  System.Windows.Forms.Application.EnableVisualStyles();
  Application.SetCompatibleTextRenderingDefault(false);
  Application.Run(new myForm());
  }
  }


using System;
using System.Collections.Generic;

 ...
  public partial class myForm : Form
 {
 int x = 0;
 }
 ...


I want to close myForm automatically when x = 0 and do not close when x = 1;

(may be this helps )

Related Tags