I asked somewhere else and managed to get a working solution. Here it is, in case anyone else has this question later on.
First off, set KeyPreview to True on the form. Then add this event handler:
Code:
procedure TfrmMyForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ssCtrl in Shift) and (Ord(Key) = VK_TAB) then
begin
if ssShift in Shift then
if TabControl.tabIndex > 0 then
TabControl.TabIndex := TabControl.tabIndex - 1
else
TabControl.TabIndex := TabControl.tabs.Count - 1
//end if
else
if TabControl.tabIndex < TabControl.Tabs.Count - 1 then
TabControl.TabIndex := TabControl.tabIndex + 1
else
TabControl.TabIndex := 0;
//end if
//end if
FocusControl(TabControl);
TabControl.OnChange(self);
end;
end;
Mason
Bookmarks