To the best of my knowledge, typing into a combo box will result in the OnChange
event firing. But it is true that modifying the text property does not.
The way I would go about getting OnChange
to fire for your combo box is to handle the CM_TEXTCHANGED
message. The handler for this needs to call the Change
method which will then call OnChange
, if it has been assigned.
As a simple example, here's an interposer class implementation:
type
TComboBox = class(StdCtrls.TComboBox)
protected
procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
end;
procedure TComboBox.CMTextChanged(var Message: TMessage);
begin
inherited;
Change;
end;