[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebView object - Event on Link click


Le 09/09/2026 à 18:07, Olivier Cruilles a écrit :
Hello,

Thank you for your answer, it helped me.

So WebView1_Url() does not fire and never raise on my case (Gambas Dev last commit), but WebView1_MouseUp() dose the job:

Public Sub WebViewDoc_MouseUp()

   Dim Champs1 As String[]

   Print "WebViewDoc.Url = " & WebViewDoc.Link

   If WebViewDoc.Link Like "doc:*" Then
     Champs1 = Scan(WebViewDoc.Link, "*:*")
     If Champs1.Count = 2 Then
      Afficher_Message("Affichage du document: " & Champs1[1] & " ...", True)
       Lecture_Fichier_Doc(Champs1[1])
     End If
   Endif

End

Olivier


To detect that the webview is redirected to a new url (either by clicking on a link or any other mean), I use the 'Start' event.

In the 'Start' event handler, I read the 'Link' property, and the 'Url' property if 'Link' is void. Then I can decide what to do with the new url.

Using STOP EVENT in that event handler aborts the request.

Regards,

--
Benoît Minisini.


References:
WebView object - Event on Link clickOlivier Cruilles <olivier.cruilles@xxxxxxxx>
Re: WebView object - Event on Link clickgbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: WebView object - Event on Link clickBruce Steers <bsteers4@xxxxxxxxx>
Re: WebView object - Event on Link clickOlivier Cruilles <olivier.cruilles@xxxxxxxx>