L
Luc The Perverse
Hey - I am making my first C# form application! (More a teach myself app
than any pratical application)
I have a listbox that always has the control so I made an event handler for
KeyDown.
I seem to be losing information when Casting to char, since I never have any
problem using special keys if I use something like e.KeyCode == Keys.Delete
But . . there is no Keys.Astericks (or Star or similar)
private void PlayList_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e){
switch((char)e.KeyValue){
case 'x':case 'X':
Close();
break;
case '*':
System.Windows.Forms.MessageBox.Show("I never get here");
break;
default:
//do nothing
break;
}
}
Two things. How am I supposed to test for normal codes like this?
Is there a way to capture things for the entire form without making a
KeyDown handler for every item in the form?
than any pratical application)
I have a listbox that always has the control so I made an event handler for
KeyDown.
I seem to be losing information when Casting to char, since I never have any
problem using special keys if I use something like e.KeyCode == Keys.Delete
But . . there is no Keys.Astericks (or Star or similar)
private void PlayList_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e){
switch((char)e.KeyValue){
case 'x':case 'X':
Close();
break;
case '*':
System.Windows.Forms.MessageBox.Show("I never get here");
break;
default:
//do nothing
break;
}
}
Two things. How am I supposed to test for normal codes like this?
Is there a way to capture things for the entire form without making a
KeyDown handler for every item in the form?