示例#1
0
        public void Open()
        {
            if (Mines.IsFinished)
            {
                return;
            }

            if (this.IsBomb)
            {
                this.BackgroundImage       = ((System.Drawing.Image)(Properties.Resources._004));
                this.BackgroundImageLayout = ImageLayout.Stretch;
                this.BackColor             = Color.Silver;
                return;
            }

            if (!this.IsOpened)
            {
                this.IsOpened        = true;
                this.BackgroundImage = null;
                this.BackColor       = Color.Silver;

                if (Arround != null)
                {
                    this.Text      = (Arround == 0) ? String.Empty : Arround.ToString();
                    this.ForeColor = LabelColors[(int)Arround];
                }
                else
                {
                    this.Text      = String.Empty;
                    this.ForeColor = Color.Black;
                }
            }
        }
示例#2
0
        public void AutoOpen()
        {
            if (this.IsMarked)
            {
                return;
            }

            if (!this.IsOpened)
            {
                this.IsOpened        = true;
                this.BackgroundImage = null;
                this.BackColor       = Color.Silver;

                if (Arround != null)
                {
                    this.Text      = (Arround == 0) ? String.Empty : Arround.ToString();
                    this.ForeColor = LabelColors[(int)Arround];
                }
                else
                {
                    this.Text      = String.Empty;
                    this.ForeColor = Color.Black;
                }
            }
        }