first time posting, so hopefully I'll get lucky.
I have written this method to filter input to textboxes and only allow binary:
private void binaryInput_KeyPress(object sender, KeyPressEventArgs e)
{
// Binary and functions only!
if(e.KeyChar.ToString() != "1" && e.KeyChar.ToString() != "0" && !Char.IsControl(e.KeyChar))
e.Handled = true;
}
Works like a dream!
Now I'm trying to implement it for DataGridView.
This class also has the KeyPressedEvent, but for some reason it doesn't invoke the event when a key is pressed to edit a Cell.
Any givers?
Thanks a mil
Paul

New Topic/Question
Reply




MultiQuote




|