예제 #1
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if ((bool)thread?.IsAlive)
     {
         thread.Abort();
     }
     sort.bmp.Dispose();
     sort = null;
 }
예제 #2
0
        public MainForm()
        {
            InitializeComponent();

            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            masN = 20;

            sort = new VisualiseSort(PictureBox, masN, delay);
            sort.DrawMas();
            thread          = new Thread(new ThreadStart(Start));
            timer1.Tick    += new EventHandler(Update);
            timer1.Interval = delay;
            timer1.Start();
        }