That worked perfectly. I figured it would be something along those lines but I couldn't get it right. Looks like my more complex solution was at fault. Oh well.
Thanks!
Edit: If anyone is interested here is the code I used. it's a slightly modified version of the one above and should give more customizability.
csharp Code:
private Dictionary<int, char> secret_code = new Dictionary<int, char>()
{
{0, 't'},
{1, 'e'},
{2, 's'},
{3, 't'}
};
private void frmMain_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == secret_code[key_presses])
{
if (key_presses == (secret_code.Count() - 1))
{
this.key_presses = 0;
MessageBox.Show("You sound the secret!", "Congratulations!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
++this.key_presses;
}
}
else
{
this.key_presses = 0;
}
}