HtmlWindow.ScrollTo 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将窗口滚动到指定的位置。
重载
| ScrollTo(Point) | 
						   将窗口移动到指定的坐标。  | 
        	
| ScrollTo(Int32, Int32) | 
						   将窗口滚动到指定的位置。  | 
        	
ScrollTo(Point)
将窗口移动到指定的坐标。
public:
 void ScrollTo(System::Drawing::Point point);
	public void ScrollTo (System.Drawing.Point point);
	member this.ScrollTo : System.Drawing.Point -> unit
	Public Sub ScrollTo (point As Point)
	参数
- point
 - Point
 
页面应该滚动到的 x 和 y 坐标,相对于当前窗口的左上角。
示例
下面的代码示例将滚动到用户单击的坐标位置。
HtmlWindow resizableWindow = null;
private void ResizeWindow()
{
    if (webBrowser1.Document != null)
    {
        resizableWindow = webBrowser1.Document.Window.OpenNew(new Uri("http://www.microsoft.com/"), "");
        resizableWindow.ResizeTo(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
    }
}
Dim ResizableWindow As HtmlWindow
Private Sub ResizeWindow()
    If (WebBrowser1.Document IsNot Nothing) Then
        ResizableWindow = WebBrowser1.Document.Window.OpenNew(New Uri("http://www.microsoft.com/"), "")
        ResizableWindow.ResizeTo(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
    End If
End Sub
    	注解
ScrollTo 将导致文档滚动,以便文档上的指定坐标位于文档窗口的左上角。 如果文档的长度或宽度不够大, ScrollTo 则尽可能按指定方向滚动浏览文档。
另请参阅
适用于
ScrollTo(Int32, Int32)
将窗口滚动到指定的位置。
public:
 void ScrollTo(int x, int y);
	public void ScrollTo (int x, int y);
	member this.ScrollTo : int * int -> unit
	Public Sub ScrollTo (x As Integer, y As Integer)
	参数
- x
 - Int32
 
页面应该滚动到的 x 坐标,相对于当前窗口的左上角。
- y
 - Int32
 
页面应该滚动到的 y 坐标,相对于当前窗口的左上角。
注解
ScrollTo 将导致文档滚动,以便文档上的指定坐标位于文档窗口的左上角。 如果文档的长度或宽度不够大, ScrollTo 则尽可能按指定方向滚动浏览文档。