Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
w2m
Posted - Feb 07 2015 : 14:06:55 If you use ImageEnView1SpecialKey to detect vkup and vkdown to set the ImageEnMView.SelectedImage is it possible to disable the internal ImageEnMView keys so the selected image is not set twice... one in the SpecialKey event and again in the internal key handling of the ImageEnMView component itself?
If you try to set the ImageEnMView.SelectedImage in a TForm1.FormKeyDown event with vkup and vkdown the selected image is set twice. Once in the FormKeyDown event and again in the ImageEnMView component itself with its internal key handling.
How can the internal ImageEnMView key handling be disabled so an external function can set the ImageEnMView selected image?
What I am trying to achieve is one procedure that detects key presses regardless if the form or ImageEnMView has the focus and to increment the Selected index up or down only one time.
Posted - Feb 08 2015 : 12:20:00 Thanks Nigel, That worked well. I wound up setting the up and down arrows as global hotkeys so that the thumbnails would scroll regardless of what control was the active or focused control. Works perfect.
Use OnKeyDown to override the internal internal handling of TImageEnMView.
procedure TForm1.ImageEnMView1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
If DoSomethingWithKey( Key, Shift ) then
Key := 0;
end;