Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            KeyDown = new KeyboardHook();
            KeyDown.SetHook();
            KeyDown.OnKeyDownEvent += kh_OnKeyDownEvent;

            for (int i = 0; i < n * n; i++)
            {
                PicBox[i]           = new PictureBox();
                PicBox[i].Size      = new Size(15, 15);
                PicBox[i].BackColor = Color.Black;
                //Btn[i].Enabled = false;
                PicBox[i].Margin = new Padding(0); //new Padding(left, top, right, bottom);
                MainPanel.Controls.Add(PicBox[i]);
            }

            //窗体大小不可改变
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MinimizeBox     = false; //去掉最小化按钮
            this.MaximizeBox     = false; //去掉最大化按钮

            //窗体图标
            this.Icon = tanchishe.Properties.Resources.bird1934;
        }