HtmlWindow.MoveTo Method (Point)


Moves the window to the specified coordinates on the screen.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void MoveTo(
	Point point


Type: System.Drawing.Point

The x- and y-coordinates of the window's upper-left corner.

Exception Condition

The code trying to execute this operation does not have permission to manipulate this window. See the Remarks section for details.

You cannot use MoveTo to move a window off of the visible edge of the screen; this method is also available through script on a Web page, and allowing untrusted script to render windows invisible is not considered secure.

MoveTo will raise an UnauthorizedAccessException if the window you are trying to move and its parent window have different top-level domains. For example, if you are hosting the WebBrowser control pointing to, create a new window using OpenNew to display In this case, both windows are considered to be part of the same top-level domain, and the exception is not thrown. However, if you call OpenNew to display www,, the two windows now have different top-level domains, and the MoveTo operation will cause the exception to throw.

.NET Framework
Available since 2.0
Return to top