Results 1 to 3 of 3

Thread: Rich text box question

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Location
    West Launceston
    Posts
    15

    Post

    How do you read from a richtext box line by line???
    For example get a line from a richtextbox add it to a string
    say named Fly so my program could check that string, and the get the next line and make the string named Fly this new line so I could check that and so until the end of the rich text box?

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Post

    It depends whether you want to use rich text or not. Often this control is use for normal text in which case you can split the string into an array of lines

    (Not debugged at all)

    Dim StrLines() As String
    StrLines = Split(RTFBox.Text, VbCrLf)

    This way UBound(StrLines) will give you the line count (array size)

    BUT if you're using RTF (RTFBox.RTFText ??) then the newline is an RTF code so you'll have to deal directly with the RTF code (not very fun)


  3. #3
    Member
    Join Date
    Jan 1999
    Location
    Longmont,CO
    Posts
    53

    Post

    This site has a good article about using the API to get line #, line text, # of lines in a textbox, etc. It's called Extending The TextBox Control. The API calls will work with a RichTextBox also.

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