user1527613
user1527613

Reputation: 1120

Manually scrolling through a TComboBox

I have not been able to figure out why I am unable to manually scroll through a TComboBox component when I programatically cause the drop down pick list to appear. Here is the code I am using:

SendMessage(ComboBox1.handle, CB_SHOWDROPDOWN, Integer(True), 0);

This causes the drop down pick list to appear. However, if I try to use my keyboard and use the up and down arrow keys, the drop down pick list immediately closes. How do I keep the list from auto-closing when using the keyboard up/down navigation keys?

Upvotes: 1

Views: 1386

Answers (1)

Sertac Akyuz
Sertac Akyuz

Reputation: 54802

Activate the ComboBox. And you'd better use the DroppedDown property, which also invalidates the combobox to reflect the change.

ActiveControl := ComboBox1;
ComboBox1.DroppedDown := True;

Upvotes: 5

Related Questions