Absolute Position of ToolBar Button lazarus / 31-LCL ---------------------------------------------------------------------- krsears · 2009-10-23 01:01 I need to connect a newly created form to the current position of a toolbutton in a toolbar.  Is there any way to get the absolute position of the button so that the form's position can be set? Thanks Kendall ---------------------------------------------------------------------- rupi · 2022-02-22 16:00 The only way I got: Get the Position of the ToolBar itself and get the Mousepointer Position Dim pos As Point = ToolBar1.PointToScreen(Point.Empty) pos.Y += ToolBar1.Height + 5 Dim posNew = New Point(MousePosition.X - 30, pos.Y) ---------------------------------------------------------------------- wp · 2022-02-22 16:13 Why not query the Left property of the clicked toolbutton? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.ToolButton1Click(Sender: TObject);var  btn: TToolButton;begin  btn := Sender as TToolbutton;  Caption := Format('Relative to toolbar: %d, relative to screen: %d', [btn.Left, Toolbar1.ClientToScreen(btn.BoundsRect.TopLeft).X]);end; ---------------------------------------------------------------------- dseligo · 2022-02-22 19:33 Quote from: wp on February 22, 2022, 05:13:44 pmWhy not query the Left property of the clicked toolbutton? Do you think OP still need this? ---------------------------------------------------------------------- wp · 2022-02-22 21:00 What's wrong with it? The OP wants to find the "position" of a toolbutton in a toolbar, probably in order to align a newly created form with the button. And this is the value of the property "Left" of the toolbutton. And I am assuming that the "current toolbutton" is the clicked toolbutton (there's nothing else which can be done with toolbuttons...). ---------------------------------------------------------------------- jamie · 2022-02-22 21:57 Quote from: dseligo on February 22, 2022, 08:33:21 pmQuote from: wp on February 22, 2022, 05:13:44 pmWhy not query the Left property of the clicked toolbutton? Do you think OP still need this?  LOL, some of us are SLOW ---------------------------------------------------------------------- wp · 2022-02-22 22:37 Ahhh!