Skip to main content
A newer version of this page is available. .

TCustomdxBarCombo Class

The base class for combo box items that implement custom dropdown windows.

Declaration

TCustomdxBarCombo = class(
    TdxBarEdit
)

Remarks

Your dropdown window implementation should contain the following methods in addition to your code.

constructor <DropDownWindowClass>.Create(AOwner: TComponent);
begin
  inherited;
  Visible := False;
end;
procedure <DropDownWindowClass>.CreateParams(var Params: TCreateParams);
begin
  inherited;
  with Params do
    ExStyle := ExStyle or WS_EX_TOOLWINDOW or WS_EX_TOPMOST;
end;
procedure <DropDownWindowClass>.CreateWnd;
begin
  inherited;
  Windows.SetParent(Handle, 0);
  CallWindowProc(DefWndProc, Handle, WM_SETFOCUS, 0, 0);
end;

The OnGetDropDownWindow event handler has to return the handle of the newly created dropdown window. You may also specify its size in this event handler. You can handle the OnCheckKeyForDropDownWindow event to process key press events in the dropdown window, if necessary.

See Also