QUOTE(daveofgv @ 2 Aug, 2009 - 06:37 AM)

Hello everyone,
I have a quick question that I am sure will be answered very quickly........
I am using:
CODE
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
KeyboardFilter filter = new KeyboardFilter(new Keys[] { Keys.LWin, Keys.RWin, Keys.Escape | Keys.Control });
}
for a checkbox. It works great to disable control + escape, however, I can not seem to cancel the method when the user unchecks the checkbox.
Does anyone know how I can make the ctrl+esc work again when the user unchecks the box?
thanks
daveofgv
You could try and use the Checked property of the check box to set the filter.
CODE
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
KeyboardFilter filter;
if (checkBox5.Checked)
filter = new KeyboardFilter(new Keys[] { Keys.LWin, Keys.RWin, Keys.Escape | Keys.Control });
else
filter = new KeyboardFilter(new Keys[] { Keys.LWin, Keys.RWin });
}