Hi, I found that if I didn't have the horizontal scroll bar enabled, it would completely mess up my styledtext locations.
It seems to be something to do with the automatic word wrap that occurs when the horizontal scroll bar is not enabled. I've been working on a HTML highlighting editfield which seems to work well with horizontal scroll bars but as soon as word wrap is on then all the alignment of the highlighting goes to pot. Dunno if it's something to do with extra endofline characters being inserted at wrap points that aren't taken into account by the instr statements? Anyone else found this? RBNUBE wrote: > When working with StyledText, why is it that the results can be different > based on the length of the text? > > Possibly I'm doing something wrong... > > I have an EditField that contains varying numbers of lines based on a > ListBox selection. > > Keywords are highlighted (some bolded, some colored) in the text of the > ListBox. The last two lines are formatted using the code below: > > If InStr(theText, "Rename Variable:") > 0 then > keywordFirstPos = InStr(theText, "Rename Variable:") > efFolderDetails.StyledText.Bold(keywordFirstPos - 13, 16) = True > End If > > The text "Rename Variable:" will never appear more than once in the text, so > I used InStr to find it. > > 1) Why can't I use keywordFirstPos as the starting point of > efFolderDetails.StyledText.Bold? I have to subtract 13 from keywordFirstPos > to include all of the first characters of the string "Rename Variable:". > > 2) This works fine except for under certain (unknown) circumstances. For > instance, if one ListBox click causes the EditField to be filled with 50 > lines, it's OK, but if it's filled with 100 lines, the starting position of > the StyledText seems to change and the text is then colored 'improperly'. > > Thanks for any input. > > > RB5.5.5 and a mostly unused copy of 2006r2. > WinXP, 2.2 GHz, 2G RAM > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
