HtmlWindow.Position Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the position of the window's client area on the screen.
public:
property System::Drawing::Point Position { System::Drawing::Point get(); };
public System.Drawing.Point Position { get; }
member this.Position : System.Drawing.Point
Public ReadOnly Property Position As Point
Property Value
A Point describing the x -and y-coordinates of the top-left corner of the screen, in pixels.
Examples
The following code example opens a new window directly over the WebBrowser control on the form. The code example requires that your form contains an instance of the WebBrowser control named WebBrowser1
.
private void OpenNewWindowOverBrowser()
{
if (webBrowser1.Document != null)
{
HtmlWindow docWindow = webBrowser1.Document.Window;
HtmlWindow newWindow = docWindow.OpenNew(new Uri("http://www.adatum.com/popup.htm"), "left=" + docWindow.Position.X + ",top=" + docWindow.Position.Y + ",width=" + webBrowser1.Width + ",height=" + webBrowser1.Height);
}
}
Private Sub OpenNewWindowOverBrowser()
If (WebBrowser1.Document IsNot Nothing) Then
Dim DocWindow As HtmlWindow = WebBrowser1.Document.Window
Dim NewWindow As HtmlWindow = DocWindow.OpenNew(New Uri("http://www.adatum.com/popup.htm"), "left=" & DocWindow.Position.X & ",top=" & DocWindow.Position.Y & ",width=" & WebBrowser1.Width & ",height=" & WebBrowser1.Height)
End If
End Sub
Remarks
The Location property of the WebBrowser control will return the position of the control relative to the upper-left corner of the form. By contrast, Position will return the location of the document's display area relative to the top-left corner of the user's monitor.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기