0

I have a TComboEdit in a FireMonkey application.

In VCL I could do something like this:

  SendMessage(myComboEdit.Handle, CB_SHOWDROPDOWN, 1, 0);

Of course, messaging in FMX works differently than in VCL so this trick appears not to work under FMX. (i.e., it's not exposed to us).

How can I coax my TCombiEdit to show the drop down?

1 Answer 1

3

To show the dropdown of a TComboEdit control you can use the DropDown method like this

 ComboEdit1.DropDown;

or send a PM_DROPDOWN message using the SendMessage method of the model.

 ComboEdit1.Model.SendMessage(PM_DROPDOWN);
2
  • Works. I've noted that the DropDown method is a toggle on and off. So I needed to add an "If not ComboEdit1.DroppedDown then" to prevent it from closing an already open DropDown.
    – BIBD
    Nov 25, 2015 at 20:23
  • Also, "ComboEdit1.Model.SendMessage(PM_DROPDOWN" seems to act as a toggle on DropDown as well. It's partner "ComboEdit1.Model.SendMessage(PM_CLOSE_DROPDOWN" does not, so you could also do an explicit close, and then toggle DropDown as well.
    – BIBD
    Nov 25, 2015 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.