private void Main_KeyPress(object sender, KeyPressEventArgs e) { switch (e.KeyChar) { case 'q': { TileHandler.DisallowAllAroundSelected((TileTab)tbcMain.SelectedIndex); _PictureBoxes[tbcMain.SelectedIndex].Invalidate(); break; } case 'w': { _EnableGrid = !_EnableGrid; pctbMain.Invalidate(); pctbTileTest.Invalidate(); pctbSelectedTile.Invalidate(); break; } case 'e': { if (bgwDisallowGroups.IsBusy != true) { bgwDisallowGroups.RunWorkerAsync(tbcMain.SelectedIndex); } break; } case 'r': { TileHandler.DisallowEverythingNotAttributed((TileTab)tbcMain.SelectedIndex); pctbMain.Invalidate(); pctbTileTest.Invalidate(); pctbSelectedTile.Invalidate(); break; } } }