HtmlWindow.ScrollTo 方法

定義

滑動視窗到指定位置。

多載

名稱 Description
ScrollTo(Point)

將視窗移動到指定的座標。

ScrollTo(Int32, Int32)

滑動視窗到指定位置。

ScrollTo(Point)

來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs

將視窗移動到指定的座標。

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)

來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs
來源:
HtmlWindow.cs

滑動視窗到指定位置。

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 會盡可能往指定方向滾動。

適用於