Public Class Form1
Dim htmlDoc As HtmlDocument
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.DocumentText = "<body contenteditable=true>Tento text</body>"
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
htmlDoc = WebBrowser1.Document
AddHandler htmlDoc.Click, AddressOf htmlDoc_Click
End Sub
Sub htmlDoc_Click(ByVal sender As Object, ByVal e As HtmlElementEventArgs)
MsgBox(e.MousePosition.X & " " & e.MousePosition.Y)
' stop mouse events moving on to the HTML doc
e.ReturnValue = False
End Sub
End Class
Tak toto je pozícia myši. Z toho by som potreboval charIndex.
|