Results 1 to 6 of 6

Thread: ListView Q

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    23

    Post

    I have a rich text box with three colours, red, green and yellow. How can I extract only the red text from this RTF.....

    Thank you.
    Any help will be great

  2. #2
    Member
    Join Date
    Feb 1999
    Location
    NY
    Posts
    45

    Post

    Here's an algorithm:

    Function GetRedString(rtf as RichTextBox) As String

    dim i as long,ret as string
    rtf.sellength = 1

    for i = 1 to len(rtf.text)
    rtf.selstart = i
    if rtf.selcolor = vbRed then ret = ret & rtf.seltext
    next i
    GetRedString = ret
    End Function

    I just wrote that off the top of my head, so im not 100% sure it works, give it a whirl. Basically it checks the RGB value of each character in the textbox against the selected color, if they match it adds the character to a string, and returns it.


    ------------------
    -Mystiq

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    23

    Post

    Thank you mystiq.

    In the algorithm you provided, the rtf.selcolor only returns the color of the last character in the RTF.

    Are there any more methods extracting the red text??

    Thankful

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Posts
    23

    Post

    i would like to know how to communciate with a com port. when the input to the com port only have the transmit data pins and earth, no rts and cts. can i use comEvent to do it?

  5. #5
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    How can I add all files from some directory to a ListView (something like Explorer).
    Thanks for your response

    ------------------
    Visual Basic Programmer
    ------------------
    PolComSoft
    You will hear a lot about it.


  6. #6
    New Member
    Join Date
    Dec 1999
    Location
    Tel-Aviv, Israel
    Posts
    4

    Post

    A great example !: http://codeguru.developer.com/vb/articles/1958.shtml

    Another place to find the an example is http://www.mvps.org/ccrp (i have download it, if you can not find i will send you a copy)
    and ... http://www.vb-helper.com/HowTo/treelist.zip also a good example!
    Bye

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width