private void StartButton_Click(object sender, EventArgs e) { //Boolean[,] CheckList = new Boolean[32, 2]; CheckBox[,] CheckBoxList = new CheckBox[32, 2]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 2; j++) { CheckBoxList[i, j] = this.Controls[String.Format("checkBox{0}", (i * 2 + j) + 1)] as CheckBox; } } while (true) { if (EventGeneration.GetAsyncKeyState(0x78 /*VK_F9*/) == 0x8000) { break; } } for (int i = 0; i < 32; i++) { for (int j = 0; j < 2; j++) { if (CheckBoxList[i, j].Checked == true) { Synthesis(i % 8, (i / 8) * 4 + (j * 2), i % 8, (i / 8) * 4 + (j * 2) + 1); if (EventGeneration.GetAsyncKeyState(0x79 /*VK_F10*/) == 0x8000) { Application.Exit(); } //MessageBox.Show(Convert.ToString(i % 8) + "," + Convert.ToString((i / 8) * 4 + (j * 2))+"\n"+ // Convert.ToString(i % 8) + "," + Convert.ToString((i / 8) * 4 + (j * 2)+1)); } } } }
private void PotenOpenButton_Click(object sender, EventArgs e) { CheckBox[,] CheckBoxList = new CheckBox[32, 2]; for (int i = 0; i < 32; i++) { for (int j = 0; j < 2; j++) { CheckBoxList[i, j] = this.Controls[String.Format("checkBox{0}", (i * 2 + j) + 1)] as CheckBox; } } while (true) { if (EventGeneration.GetAsyncKeyState(0x78 /*VK_F9*/) == 0x8000) { break; } } for (int i = 0; i < 32; i++) { for (int j = 0; j < 2; j++) { if (CheckBoxList[i, j].Checked == true) { PotenOpen(i % 8, (i / 8) * 4 + (j * 2)); PotenOpen(i % 8, (i / 8) * 4 + (j * 2) + 1); if (EventGeneration.GetAsyncKeyState(0x79 /*VK_F10*/) == 0x8000) { Application.Exit(); } } } } }