How to validate iscontrolkeys in textbox keydown event in .net?
+1
A:
Hi,
This msdn page should do the trick - check the keypresseventsargs returned in the keypress or this keydown page should allow you to query the control keys (using the relevant .Net enum)
ip
2008-10-28 16:01:49
A:
in C#,
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.ControlKey)
{
//Do some work
}
}
in VB.NET,
Private Sub textBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode = Keys.ControlKey Then
'Do some work'
End If
End Sub
Russ Cam
2008-10-28 16:09:59