Subject AW: [IBO] IB_ComboBox and ESC-Key
Author Dirk Schiffler
It works fine.
Thank you very much.

Best regards
Dirk Schiffler
ds@...


-----Ursprüngliche Nachricht-----
Von: Geoff Worboys [mailto:geoff@...]
Gesendet: Donnerstag, 15. Februar 2001 13:07
An: IBObjects@yahoogroups.com
Betreff: Re: [IBO] IB_ComboBox and ESC-Key


I suspect that TIB_ComboBox is swallowing the escape key when perhaps
it should not. Do you have full source? If so, can you try updating
the following function in IBC_ComboBox.IMP, adding the lines as shown.

procedure TIB_CustomComboBox.KeyPress(var Key: Char);
begin
inherited KeyPress(Key);
if (Key in [#32..#255]) and (DataLink.Field <> nil) and
not DataLink.Field.IsValidChar(Key) then
begin
MessageBeep(0);
Key := #0;
end;
case Key of
^H, ^V, ^X, #32..#255:
DataLink.Modify;
#27:
begin
if DroppedDown and // <<-- ADD
not(Style = csSimple) then // <<-- ADD
DroppedDown := false // <<-- ADD
else // <<-- ADD
begin // <<-- ADD
SysDataChange( nil );
SelectAll;
end; // <<-- ADD
Key := #0;
end;
end;
end;


See whether this works as you expect and let us know the result.

HTH

Geoff Worboys
Telesis Computing