Changes to JvDBLookup to allow TAB key to select records. private { Modified: Tristan Marlow - 31-07-2007 } FTabSelects : Boolean; { Modified: Tristan Marlow - 31-07-2007 } published { Modified: Tristan Marlow - 31-07-2007 } property TabSelects : Boolean read FTabSelects write FTabSelects; { Modified: Tristan Marlow - 31-07-2007 } procedure TJvDBLookupCombo.CNKeyDown(var Msg: TWMKeyDown); begin { Modified: Tristan Marlow - 31-07-2007 } if (FTabSelects) and (Self.IsDropDown) then begin If Msg.Charcode = VK_TAB then begin Msg.Charcode := VK_RETURN; end; end; { Modified: Tristan Marlow - 31-07-2007 } if not (csDesigning in ComponentState) then if (Msg.CharCode in [VK_RETURN, VK_ESCAPE]) and FListVisible and FLookupMode and FDataLink.DataSourceFixed then begin CloseUp(Msg.CharCode = VK_RETURN); Msg.Result := 1; Exit; end; inherited; end; procedure TJvDBLookupCombo.KeyPress(var Key: Char); begin if FListVisible then begin { Modified: Tristan Marlow - 31-07-2007 } if (FTabSelects) and (Self.IsDropDown) then If Key = Tab then Key := Cr; { Modified: Tristan Marlow - 31-07-2007 } if Key in [Cr, Esc] then begin CloseUp(Key = Cr); Key := #0; end else FDataList.KeyPress(Key) end else begin if Key in [#32..#255] then begin DropDown; if FListVisible then FDataList.KeyPress(Key); end else if (Key = Esc) and FEscapeClear and (not ValueIsEmpty(FValue)) and CanModify then begin ResetField; // Key := #0; if FValue = FEmptyValue then Key := #0; // Polaris end; end; inherited KeyPress(Key); if Key in [Cr, Esc] then GetParentForm(Self).Perform(CM_DIALOGKEY, Byte(Key), 0); end;