I am having one heck of a time trying to trap the Delete key from an ultracombo...I have been playing with both the KeyDown and PreviewKeyDown events and I've had great success with all other keys, including stubborn ones like Tab and the arrow keys, even Backspace, but I just can't trap Delete.
I've tried the GetAsyncKeyState function from the User32 Lib (recommended by numerous dev forums for regular MS controls) with no luck...
Anyone have any ideas?Thanks!
Hi Leonardo,
The event which is firing when you use the shortcut key is called 'ToolClick'. This is the event that is firing when a tool is clicked too. Other events are 'ToolKeyDown' and 'ToolKeyUp' when a key is pressed when a tool has the "focus".
Hi all,
Why aren't keys trapped when they are set as shortcut? Is there a way to avoid this behavior?
I've to perceive when a method is call by a shortcut or a mouse click.
My idea was to trap the shortcut before the method was called with the KeyDown event and setting "PreviewKey = true".
I solved the issue by doing it like this:
protected
keyData)
{
.Tab && _ucTab4Month.Focused)
(_ugTab4ResourceConflicts.Rows.Count > 0)
_ugTab4ResourceConflicts.Focus();
_ugTab4ResourceConflicts.Selected.Rows.Clear();
_ugTab4ResourceConflicts.Selected.Rows.Add(_ugTab4ResourceConflicts.Rows[0]);
_ugTab4ResourceConflicts.ActiveRow = _ugTab4ResourceConflicts.Rows[0];
}
;
else
msg, keyData);
I'm now trying something like this, but it still will never hit the PreviewKeyDown event :-(
private
e)
)
_tabRegistered =
(_tabRegistered)
//here I'll do the funky stuff ....
Hi pkirsch !
This event does NOT fire when I TAB throught the form ... and into the UltraCombo control and then TAB out of it ( I don't push any other buttons than TAB ) ... please help ?