title: Delphi Mouse Click Coordinates
body: <p><img src="https://i.stack.imgur.com/MlEY9.png" alt="enter image description here"></p>
  
  <p>Hi, i' ve 3 panels consisting of form.
  I assigned a click event to 3rd panel to getting coordinates.</p>
  
  <pre><code>procedure TformMain.Panel3Click(Sender: TObject);
  var
    pt : tPoint;
  begin
    pt := Mouse.CursorPos;
    ShowMessage('X : ' + IntToStr(pt.X) + ' &amp; Y : ' + IntToStr(pt.Y));
  end;
  </code></pre>
  
  <p>This code works, but i don' t know how to Y coord. starting from beginning of the panel 3.
   I mean when i click the panel3' s top, it's y coord must be 0.</p>
  
  <p>Thanks in advice.</p>
  
  <p>p.s. : My form has a main menu, so i tried to subtract panel1 height from the pt.y but i couldnt get main menu's height.</p>