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 8551709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:15:16+00:00 2026-06-11T14:15:16+00:00

I want to mimic the TComBo list function which is closed when the user

  • 0

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 ?

  • 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-06-11T14:15:18+00:00Added an answer on June 11, 2026 at 2:15 pm

    Assuming your panel is focussed (as I “read” from your question), then respond to the CM_CANCELMODE message which is send to all focussed windows.

    type
      TPanel = class(Vcl.ExtCtrls.TPanel)
      private
        procedure CMCancelMode(var Message: TCMCancelMode); message CM_CANCELMODE;
      end;
    
      ...
    
    { TPanel }
    
    procedure TPanel.CMCancelMode(var Message: TCMCancelMode);
    begin
      inherited;
      if Message.Sender <> Self then
        Hide;
    end;
    

    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.OnMessage handler) and compute whether the click was within the bounds of your panel:

    procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
      var Handled: Boolean);
    begin
      if Panel1.Visible and
          (Msg.message >= WM_LBUTTONDOWN) and (Msg.message <= WM_MBUTTONDBLCLK) and
          not PtInRect(Panel1.ClientRect, Panel1.ScreenToClient(Msg.pt)) then
        Panel1.Hide;
    end;
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to mimic the folder animation. is there an open source library which
is there a way to mimic the behavior of ctrl+click which keeps previously selected
Is it possible to mimic the loadlibrary function? I want to load a library
I want to mimic the Excel equivalent PERCENTILE function in C# (or in some
Is there any way I can mimic this list in CSS? I want to
I want to mimic the Google suggestion list, so I have an autocomplete for
I want to mimic a Python functionality in Java. In Python if I want
I want to mimic the trim behavior of Photoshop (crop the area that is
I have a slideshow built in flash that I want to mimic in jQuery.
I want to draw some listview items disabled and would like to mimic the

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.