using System;

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

namespace SmartDeviceProject1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            #if DEBUG
                MinimizeBox = false;
            #else
                MinimizeBox = true;
            #endif
        }

        [DllImport("coredll.dll")]
        static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

        const int SW_MINIMIZE = 6;

        void MinimizeWindow()
        {
            // The Taskbar must be enabled to be able to do a Smart Minimize
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.WindowState = FormWindowState.Normal;
            this.ControlBox = true;
            //this.MinimizeBox = true;
            this.MaximizeBox = true;

            // Сворачиваем окно
            ShowWindow(this.Handle, SW_MINIMIZE);
        }

         private void butMinimize_Click(object sender, EventArgs e)
        {
            MinimizeWindow();
        }
    }
}