I want to mimic the TComBo list function which is closed when the user click ‘outside’ the list, but for another component (a TPanel). In Delphi XE2.
Any Idea ?
I want to mimic the TComBo list function which is closed when the user
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Assuming your panel is focussed (as I “read” from your question), then respond to the
CM_CANCELMODEmessage which is send to all focussed windows.When the panel itself is not focussed, e.g. a child control is, then this will not work. In that case you could track all mouse clicks (e.g. by the use of a
TApplicationEvents.OnMessagehandler) and compute whether the click was within the bounds of your panel:But this still will not succeed when the click was – for example – in the list of a combobox which belongs to the panel but is partly unfolded outside of it. I would not know how to distil the panel from that click information.