user461051
user461051

Reputation: 431

Is there a way in C#.Net to find the location of a textbox control on a Winform relative to the screen resolution?

I know the location property gives you the location of the control relative to the Winform it is on. But I want to know the x,y coordinates relative to the top left corner of the display, not the Winform.

I had suggestions for using com interop and make an unmanaged call but wanted to know if there was something native to .Net.

Thanks, Dan

Upvotes: 0

Views: 793

Answers (1)

Konamiman
Konamiman

Reputation: 50323

What you are looking for is probably the Control.PointToScreen method:

Computes the location of the specified client point into screen coordinates.

The inverse is the Control.PointToClient method, by the way.

Upvotes: 2

Related Questions