On Mar 23, 2006, at 4:48 PM, Sven E Olsson wrote:
I also found that the scroll NOT take affect even if the window and
EditField have focus.
I have tried to find this out now for some hours, but it looks like
an bug in RB or perhaps in the OS?
Or is there some other that this works well for (on OS X) ?
Sven,
I created a window with a multiline editfield, a second editfield for
entering the text to find, and a Find button. In the action event of
the Find button I have the following code and it is scrolling the
listbox for me and highlighting the text found. This is OS X 10.4.5
and RB2005 R4
Sub Action()
Dim efLine, pos, numChars As Integer
Dim stringToFind As String
stringToFind = efToFind.Text
if stringToFind = "" then
beep
MsgBox "You have not entered any characters to be found"
efToFind.SetFocus
return
end if
pos = InStr(efTest.text, stringToFind)
if pos = 0 then
beep
MsgBox "The string '" + stringToFind + "' was not found within
the editfield contents"
return
end if
numChars = len(stringToFind)
efTest.SelStart = pos - 1
efTest.SelLength = numChars
efLine = efTest.LineNumAtCharPos(pos)
efTest.ScrollPosition = efLine
//efTest.SetFocus
End Sub
=== A Mac addict in Tennessee ===
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>