日期:2014-05-17 浏览次数:20957 次
private void ChooseToOverTurn(int count)
{
Random ran = new Random();
int[] chooseIndex = new int[count];
for (int i = 0; i < count; i++)
{
chooseIndex[i] = ran.Next(0, (count - 1) * (count - 1));
}
Image imgWhite = new Bitmap("images/white.png");
foreach (Control c in this.panelMain.Controls)
{
if (c.GetType() == typeof(PictureBox))
{
for (int i = 0; i < count; i++)
{
if (c.Text == chooseIndex[i].ToString())
{
PictureBox p = c as PictureBox;
p.Image = imgWhite;
}
}
}
}
}
private void TurnBack()
{
Image imgBlack = new Bitmap("images/black.png");
System.Threading.Thread.Sleep(1000); //1000ms Wait for turnback
foreach (Control c in this.panelMain.Controls)
{