|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RichTextBox(1) what are the rules / ability of a RTB containing a photo? i.e. how do I get one in? programmatically and manually? How do I place it? How to move it about? How do I get it out. I have been fiddling with this and not sure how to do it. (2) I am trying to write RTB code to do the following: a)Load in a bunch of test. b)Search the text for a word. c)Color the word. d)Continue the search to color the next word. I can do (a) thru (c), but at (d) the pointer gets messed up and the cursor seems to be in the wrong place. I know that coloring the text adds characters to the RTB but I am not sure how to compensate for that so all my "pointers" are set correctly. Hint for (2): Stfrt searching from bottom and move upwards to handle
characters inserted. -- Show quoteHide quoteIRFAN. "Lorin" wrote: > VB6SP6 > > (1) what are the rules / ability of a RTB containing a photo? > i.e. how do I get one in? > programmatically and manually? > How do I place it? > How to move it about? > How do I get it out. > I have been fiddling with this and not sure how to do it. > > (2) I am trying to write RTB code to do the following: > a)Load in a bunch of test. > b)Search the text for a word. > c)Color the word. > d)Continue the search to color the next word. > I can do (a) thru (c), but at (d) the pointer gets messed up and the cursor > seems to be in the wrong place. > I know that coloring the text adds characters to the RTB but I am not sure > how to compensate for that so all my "pointers" are set correctly. > > As far as I remember I once could insert a bitmap via
clipboard copy/paste. But there is no easy way to float the text around the picture, f.e. like in Word, or to address the encapsulated image. A rich text box is not a complete word processor. Concerning cursor positioning you don't have to count the RTFtext's characters, simply count the visible text's characters, f.e. like RTFBox.SelStart=10 'position cursor to visible char #10 RTFBox.SelLength=5 'set next 5 char highlighted RTFBox.SelText="anything" 'replace highlighted text by "anything" This is all independent from existing formatings. |
|||||||||||||||||||||||