[Gambas-user] Finding the TextEditor search string for FindNextString()

Bruce Steers bsteers4 at gmail.com
Mon Mar 20 15:47:37 CET 2023


On Mon, 20 Mar 2023 at 11:55, Bruce Steers <bsteers4 at gmail.com> wrote:

> If i use TextEditor1.ShowFindPanel() to do a search how can i get the
> entered search string to use on TextEditor1.FindNextString(SearchString) ?
>


Never mind.

I checked out the source and found it's not designed that way.

But here is a way if you need it...
I used what i learned from the source to do the following to make a
moveNext/Prev command ....

Public Sub mnuFindNext_Click()

  Dim hObject As Object = ActiveEd().TEdit1.Children[0] ' editor view
  If hObject.Children.Count = 1 Then Return ' FFind is null so return
  hObject = hObject.Children[1]  ' the FFind form
  hObject.btnNext_Click

End

Public Sub mnuFindPrev_Click()

  Dim hObject As Object = ActiveEd().TEdit1.Children[0]
  If hObject.Children.Count = 1 Then Return
  hObject = hObject.Children[1]
  hObject.btnPrevious_Click

End


Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230320/13b05c54/attachment.htm>


More information about the User mailing list