Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:32:39+00:00 2026-05-29T07:32:39+00:00

Ordinary Windows ComboBox ( csDropDown or csDropDownList style) will open its dropdown list right

  • 0

Ordinary Windows ComboBox (csDropDown or csDropDownList style) will open its dropdown list right below or, if no space left below, above the combo. Can I control the position of this list (at least by Y coordinate)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:32:41+00:00Added an answer on May 29, 2026 at 7:32 am

    Posting a code example that will show drop-down list animation correctly and will force showing the drop-down list above ComboBox1. this code subclasses ComboBox hwndList:

    TForm1 = class(TForm)
      ComboBox1: TComboBox;
      procedure FormCreate(Sender: TObject);
      procedure FormDestroy(Sender: TObject);
    private
      FComboBoxListDropDown: Boolean;
      FComboBoxListWnd: HWND;
      FOldComboBoxListWndProc, FNewComboBoxListWndProc: Pointer;
      procedure ComboBoxListWndProc(var Message: TMessage);
    end;
    
    ....
    
    procedure TForm1.FormCreate(Sender: TObject);
    var
      Info: TComboBoxInfo;
    begin
      ZeroMemory(@Info, SizeOf(Info));
      Info.cbSize := SizeOf(Info);
      GetComboBoxInfo(ComboBox1.Handle, Info);
      FComboBoxListWnd := Info.hwndList;
      FNewComboBoxListWndProc := MakeObjectInstance(ComboBoxListWndProc);
      FOldComboBoxListWndProc := Pointer(GetWindowLong(FComboBoxListWnd, GWL_WNDPROC));
      SetWindowLong(FComboBoxListWnd, GWL_WNDPROC, Integer(FNewComboBoxListWndProc));
    end;
    
    procedure TForm1.FormDestroy(Sender: TObject);
    begin
      SetWindowLong(FComboBoxListWnd, GWL_WNDPROC, Integer(FOldComboBoxListWndProc));
      FreeObjectInstance(FNewComboBoxListWndProc);
    end;
    
    procedure TForm1.ComboBoxListWndProc(var Message: TMessage);
    var
      R: TRect;
      DY: Integer;
    begin
      if (Message.Msg = WM_MOVE) and not FComboBoxListDropDown then
      begin
        FComboBoxListDropDown := True;
        try
          GetWindowRect(FComboBoxListWnd, R);
          DY := (R.Bottom - R.Top) + ComboBox1.Height + 1;
          // set new Y position for drop-down list: always above ComboBox1
          SetWindowPos(FComboBoxListWnd, 0, R.Left, R.Top - DY , 0, 0,
            SWP_NOOWNERZORDER or SWP_NOZORDER or SWP_NOSIZE  or SWP_NOSENDCHANGING);
        finally
          FComboBoxListDropDown := False;
        end;
      end;
      Message.Result := CallWindowProc(FOldComboBoxListWndProc,
        FComboBoxListWnd, Message.Msg, Message.WParam, Message.LParam);
    end;
    

    Notes:

    1. I totally agree with David, and others that this is a bad idea to change this specific default behavior for TComboBox. OP did not yet respond to why he wanted such behavior.
    2. The code above was tested with D5/XP.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF window, which contains a button called Cancel. Under ordinary circumstances
An ordinary object, I can use o.__repr__() to see something like '<__main__.A object at
Say I have an ordinary table in my db like so ---------------------------- | id
I've got a pretty ordinary Java EE application running on JBOSS. It uses the
Can I run my mod_perl aplication as an ordinary user similar to running a
Does anybody know of a method for creating custom Performance Counters using ordinary unmanaged
Let's say I'd like to start a small linux distro before my ordinary operating
Suppose I have a weak reference to a car which has an ordinary (strong)
I have a simple Google App Engine app, that I wrote using ordinary strings.
This Code Work fine with ordinary button but the button in devexpress provided me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.