This event is generated when any key is pressed.
Event Data
The event handler takes arguments of type KeyUpDownEventArgs
Explanation
The KeyDownImage event is generated when any key is pressed.
Example:
This example displays a message box when the Delete key is pressed. If the Cancel button is pressed then the deletion is cancelled.
[Visual Basic.NET]
Private Sub imageKit1_KeyDownImage(sender As Object, e As
Newtone.ImageKit.WPF.KeyUpDownEventArgs) Handles
imageKit1.KeyDownImage
If (e.key = Key.Delete) Then
Dim
result As MessageBoxResult = MessageBox.Show("削除しますか?", "確認",
MessageBoxButton.YesNo)
If
(result = MessageBoxResult.No) Then
imageKit1.Edit.CancelDeleteObjectsByDeletekey
= True
End
If
End If
End Sub
[Visual C#.NET]
private void imageKit1_KeyDownImage(object sender,
KeyUpDownEventArgs e)
{
if (e.key == Key.Delete)
{
MessageBoxResult
result = MessageBox.Show("削除しますか?", "確認",
MessageBoxButton.YesNo);
if
(result == MessageBoxResult.No)
{
imageKit1.Edit.CancelDeleteObjectsByDeletekey
= true;
}
}
}