1. Home
  2. Computing & Technology
  3. Delphi Programming
Zarko Gajic
Zarko's Delphi Programming Blog

By Zarko Gajic, About.com Guide to Delphi Programming

Understanding ScreenToClient and ClientToScreen Delphi methods

Friday October 30, 2009

in Delphi TIPS ::
Every Delphi control, descendant of the TControl class, exposes two methods you can use to convert point coordinates: ScreenToClient and ClientToScreen.

In screen coordinates (0, 0) corresponds to the upper left corner of the screen.

In client area coordinates (0, 0) corresponds to the upper left corner of the control's client area.

Read the full tip to find out when and how to use ScreenToClient and ClientToScreen

Related: Implemention OnMouseOver for Items in a TComboBox. | How to Move and Resize Controls at Run Time | TreeView with check boxes and radio buttons

Comments
November 2, 2009 at 5:04 am
(1) Ken Knopfli says:

One gotcha that cost me a lot of time is that there is an additional one-pixel border INSIDE the client area of an edit control!

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.