HOW TO GET CURRENT POSITION OF A CONTROL ON WIN FORM

Mark Devid

Total Post:102

Points:714
Posted by  Mark Devid
C# 
C#
 1072  View(s)
Ratings:
Rate this:
Am trying very hard but not find any method to get the location(x,y) of the control like picturebox on the form.
please help me ...
  1. Pravesh Singh

    Post:412

    Points:2888
    Re: How to get Current position of a control on Win Form

    Hi Mark,


    you can just use picturebox1.Left as you X and picturebox1.Top as your Y or

    you can combine PointToScreen and PointToClient:

    Point locationOnForm = control.FindForm().PointToClient(

        control.Parent.PointToScreen(picturebox1.Location));


Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!