using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace StandardApp
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            #if DEBUG
                MinimizeBox = false;
            #else       
                MinimizeBox = true;
            #endif

                SplashForm splash = new SplashForm();
                splash.ShowDialog();
        }

        private void menuItemExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            AboutForm about = new AboutForm();
            about.ShowDialog();
        }

        private void MainForm_Activated(object sender, EventArgs e)
        {
            // Здесь ваш код для восстановления связей с портами и т. д.
            lblInfo.Text = "Приложение активировано";
        }

        private void MainForm_Deactivate(object sender, EventArgs e)
        {
            // Здесь ваш код для освобождения ресурсов
            lblInfo.Text = "Приложение деактивировано";
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            LogonForm LogonFrm = new LogonForm();
            if (LogonFrm.ShowDialog() == DialogResult.Cancel)
            {
                LogonFrm.Dispose();
                this.Close();
            }
            else
            {
                this.Text += " - " + LogonFrm.txtCheck.Text;
                LogonFrm.Dispose();
            }

        }
    }
}