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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:52:07+00:00 2026-05-11T14:52:07+00:00

I have a small button I want to add to the top left corner

  • 0

I have a small button I want to add to the top left corner of a Delphi TDBGrid component (in the header/title cells). I am able to place the button easily, but now the click event is not handled. I’m guessing the event is being caught by the grid. Any way I can force this specific event to go to the button instead? Note I still need the grid to handle click events for its title buttons like it currently does.

procedure TForm38.FormCreate(Sender: TObject); begin    button1.Parent := grid;    button1.Top := 0;    button1.Left := 0;    button1.Width := 12;    button1.Height := 18;    button1.OnClick := Button1Click; end; 

**Update:**I’ve found I was able to use the button’s MouseDown event which seems to work well, but I couldn’t use the click event.

procedure TForm38.Button1MouseDown(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); begin    if ( Button = mbLeft ) then       TButton(Sender).Click; end; 
  • 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. 2026-05-11T14:52:08+00:00Added an answer on May 11, 2026 at 2:52 pm

    I am not sure why it is eating the click message. You actually simulate the click event through the MouseUp event handler.

    procedure TForm38.Button1MouseUp(Sender: TObject; Button: TMouseButton;   Shift: TShiftState; X, Y: Integer); var   ctrl: TButton; begin   ctrl := Sender as TButton;   if (x > 0) and (x < ctrl.Width) and (y > 0) and (y < ctrl.Height)  then     ctrl.Click; end; 

    If you test a normal button you will see that the click event doesn’t happen until you release the mouse. Simulating a click on button down creates odd behavior.

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

Sidebar

Related Questions

I want to add a small button beside my UITableView header that when pressed
I have compose one small application in which I want to add 20 radio
I have a small popup like this: But I don't want the padding around
I have a button on my home screen that will add an edit text
Sometimes I have a button in my UI that it is so small that
I have a small application that has several checkboxes, a submit button, and a
I want the functionality of a radio button, yet have the option of choosing
I have two questions. Before detailing these questions, I want to add I'm using
A small - little question. I have seen many application having buttons like following.
have small problem, and would very much appreciate help :) I should convert byte

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.