How can I find the index of the top item in the drop-down list of a TComboBox?
I know that a TListBox has a TopIndex property, but I can't find anything similar to this for a TComboBox.
I'm using C++Builder in RAD Studio 10.4 Update 2.
How can I find the index of the top item in the drop-down list of a TComboBox?
I know that a TListBox has a TopIndex property, but I can't find anything similar to this for a TComboBox.
I'm using C++Builder in RAD Studio 10.4 Update 2.
Since FMX's
TListBoxdoes not have aTopIndexproperty, I'm going to assume you are referring to VCL instead.In the VCL, you can access the
HWNDof theTComboBox's drop-down ListBox by calling the Win32GetComboBoxInfo()function on (or sending aCB_GETCOMBOBOXINFOmessage to) theHWNDreturned by theTComboBox::Handleproperty. And then you can send anLB_GETTOPINDEXmessage to the ListBoxHWND.