Hi, What's happening is this: User enters a word/phrase in an edit field and clicks search. Results show up in a ListBox Clicking a row of the Listbox puts the word/phrase with its complete sentence or paragraph into an Editfield for display. I want the word/phrase to be highlighted.
With this code in the display Editfield's Textchange event it works about 4 times out of 5. Dim begin as Integer begin=InStr(me.text, SearchField1.text) me.SelStart=begin-1 me.SelLength=Len(SearchField1.text) me.SetFocus // without this, it never works About 1 time in 5, the cursor is at the begining of the correct word, but the SelLength is 0. It appears unrelated to which text is selected or to what order the selections are made. It happens in both compiled app and running in the IDE. It gets stranger. After the user has displayed the complete sentence or paragraph, he can add more context (another sentence or two before what he has already displayed) to the display with this code in a button: Displayfield.text=ListBox4.CellTag(ListBox4.ListIndex, 0)+Displayfield.text If the EditField text is changed with this code, the cursor is always moved to the correct position, but the SelLength is always 0. I tried putting the highlight code in the same place with the code that puts the text into the Editfield and the cursor is always at the end of the text in the display field. RB2006r4, Linux, Mepis(Ubuntu) with KDE I just tested it in RB2007r1 and the highlight and cursor position are always wrong. Any Ideas? Don Jungk _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
