Is there a method like ScreenToWindow() function in C#?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,all

We know the rect.location represents the coordinate. For example, Rectangle
rect = ListView.GetItemRect(0);, the coordinate is the coordinate in this
ListView control, is there a easy way the get the correspoding coordinate
which relative to the window or whole screen? becuase there may be many level
contorls which contian the ListView.

Thanks
 
=?Utf-8?B?Tmlja3k=?= said:
We know the rect.location represents the coordinate. For example,
Rectangle rect = ListView.GetItemRect(0);, the coordinate is the
coordinate in this ListView control, is there a easy way the get the
correspoding coordinate which relative to the window or whole screen?
becuase there may be many level contorls which contian the ListView.

PointToClient and PointToScreen are the functions you need to convert
between screen/client coordinates.

-mdb
 
Back
Top