Private Sub WebBrowser1_StatusTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.StatusTextChanged Debug.Print(WebBrowser1.StatusText) End Sub Private Sub WebBrowser1_DocumentTitleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.DocumentTitleChanged Debug.Print(WebBrowser1.Document.Title) End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted WebBrowser1.Document.ExecCommand("SelectAll", False, Nothing) WebBrowser1.Document.ExecCommand("Copy", False, Nothing) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim gogo As String = surf.Document.ActiveElement.InnerText If gogo <> Nothing Then Clipboard.SetText(gogo) gogo = surf.DocumentType If gogo <> Nothing Then Clipboard.SetText(gogo) If gogo = Nothing Then ' si je fais Unselect qui après ne permets de ne plus rien séléctionner donc à exclure surf.Document.ExecCommand("Unselect", False, Nothing) ' si l'utilisateur clique dans un champ le selectall ne s'applique que sur le contenu du champs surf.Document.ExecCommand("SelectAll", False, Nothing) surf.Document.ExecCommand("Copy", False, Nothing) ' OU mais pour saveas s'affiche une boite de dialogue pourtant ca ca marche dans tous les cas mais à exclure puisque boite de dialogue surf.Document.ExecCommand("SaveAs", False, "c:\testog.txt") End If
je ne souhaite pas récupérer le code qui permet l'affichage mais la résultante
mais pas ce que je vois à l'écran
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load WebBrowser1.Navigate("http://www.google.fr") End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted Dim el As HtmlElement = WebBrowser1.Document.GetElementById("btnG") AddHandler el.Click, AddressOf Test End Sub Private Sub Test() MessageBox.Show("click") End Sub