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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top