Why take the coordinates of the expanded form and not just the coordinates of the form? I need to take the coordinates of the lower right edge of the form, whether it is fully rotated to full screen or not.

buttonHide.Location = new System.Drawing.Point(this.DesktopLocation.X + this.Size.Width - 95, this.DesktopLocation.Y + this.Size.Height - 264); 

    1 answer 1

    I did not understand about the expanded form (I did not notice anything like it when working with winforms earlier) - but I see one mistake.

    The position of each control is set relative to its parent (more precisely, relative to the client area of ​​the parent) - and therefore the addition of DesktopLocation certainly an error. Another mistake is using Size instead of ClientSize . Try this:

     buttonHide.Location = new System.Drawing.Point(this.ClientSize.Width - 95, this.ClientSize.Height - 264); 

    By the way, if you are trying to move a button when changing the size of a form, then there is a much more convenient mechanism. Simply place the button in the right place and set the anchor ( Anchor ) Right | Bottom instead, which is the default.