Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
DGrothe-PhD committed Sep 11, 2023
1 parent 2a986f5 commit 6b7211e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions T9KeyboardApp/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ private void Form1_KeyPress(object sender, KeyPressEventArgs e)
}
else // if (int.TryParse("" + e.KeyChar, out int _))
{
foreach (var b in Controls)
foreach (var b in Controls.OfType<Button>())
{
if (b is Button && ((Button)b).Text[0] == e.KeyChar)
if (b.Text[0] == e.KeyChar)
{
ButtonClick(b, new EventArgs());
break;
Expand Down

0 comments on commit 6b7211e

Please sign in to comment.