Пример #1
0
 void ChangeButton(object s, ChangeArgs e)
 {
     foreach (object b in f.Controls)
     {
         if ((b as ControlButton) != null && (b as ControlButton).i == e.I)
         {
             if ((b as ControlButton).j == e.J)
             {
                 if (e.MinArr == "0")
                 {
                     (b as ControlButton).Text            = "";
                     (b as ControlButton).BackgroundImage = (System.Drawing.Image)saper.Properties.Resources.cellclear;
                 }
                 else
                 {
                     (b as ControlButton).Text            = e.MinArr;
                     (b as ControlButton).BackgroundImage = (System.Drawing.Image)saper.Properties.Resources.cellopen;
                 }
             }
         }
     }
 }
Пример #2
0
        void ChangeButton(object s, ChangeArgs e)
        {
            foreach (object b in f.Controls)
            {
                if ((b as ControlButton)!=null && (b as ControlButton).i == e.I) //студия лагает не дает записать &&
                {
                    if ((b as ControlButton).j == e.J)
                    {
                        if (e.MinArr == "0")
                        {
                            (b as ControlButton).Text = "";
                            (b as ControlButton).BackgroundImage = (System.Drawing.Image)saper.Properties.Resources.cellclear;
                        }
                        else
                        {
                            (b as ControlButton).Text = e.MinArr;
                            (b as ControlButton).BackgroundImage = (System.Drawing.Image)saper.Properties.Resources.cellopen;
                        }

                    }
                }
            }
        }