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>