HtmlDocument.Click Event
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.
Occurs when the user clicks anywhere on the document.
public:
event System::Windows::Forms::HtmlElementEventHandler ^ Click;
public event System.Windows.Forms.HtmlElementEventHandler Click;
public event System.Windows.Forms.HtmlElementEventHandler? Click;
member this.Click : System.Windows.Forms.HtmlElementEventHandler
Public Custom Event Click As HtmlElementEventHandler
Event Type
Examples
The following code example detects a click on the document, finds the element, and uses ScrollIntoView to align the element with the top of the Web page.
private void Document_Click(Object sender, HtmlElementEventArgs e)
{
if (webBrowser1.Document != null)
{
HtmlElement elem = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
elem.ScrollIntoView(true);
}
}
Private Sub Document_Click(ByVal sender As Object, ByVal e As HtmlElementEventArgs)
If (WebBrowser1.Document IsNot Nothing) Then
Dim Elem As HtmlElement = WebBrowser1.Document.GetElementFromPoint(e.ClientMousePosition)
Elem.ScrollIntoView(True)
End If
End Sub
Remarks
For more information about handling events, see Handling and Raising Events.
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET