[Gambas-user] Set cursor position on a webview editable.

Gianluigi bagonergi at ...626...
Wed Dec 7 10:51:06 CET 2016


Something like this, about your example on the Spanish forum:
'-----------------------------
Public Sub Button1_Click()

  Dim ar As String[]
  Dim i As Integer

  ar = Split(WebView1.Text, " ", Null, True)
  WebView1.html = Replace(WebView1.html, ar[ar.max], "<span
style=\"background-color: rgb(254, 254, 126);\">" & ar[ar.max] & "</span>")
  WebView1.SetFocus
  'Aquí el cursor queda al principo del texto. Lo queremos al final
  Print ar.Max, " words"
  For i = 0 To ar.Max
    Desktop.SendKeys("{[Control_L][Right]}")
  Next

End
'----------------------------------

Regards
Gianluigi

2016-12-06 21:44 GMT+01:00 Gianluigi <bagonergi at ...626...>:

> Have You tried to use Desktop.SendKeys?
>
> Regards
> Gianluigi
>
> 2016-12-04 18:06 GMT+01:00 Jorge Carrión <shordi at ...626...>:
>
>> Hi
>> I'm doing a spelling checker for a webview. When you write a wrong word it
>> is highlited. That's done, but I can't set the cursor again after the
>> word.
>> It always remains at begin of webview text...
>>
>> Is it possible to do that?
>>
>> Best Regards
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>



More information about the User mailing list