Results 1 to 7 of 7

Thread: Rich text box question

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Location
    Nashville, TN
    Posts
    54
    I have a rich text box that displays 5 names with a grade

    example:

    Jonathan
    Jeremy
    Bob
    Allen
    Heather

    I am trying to put their grade about 5 spaces away from there name, actaull at a tab stop. But I can't get it to work in the rich text box. I know on forms you can you the print syntax like tab() and spc() but they won't work in the RTB, does any have any ideas, thanks

    example:

    Jonathan B
    Jeremy A
    Bob B
    Allen A
    Heather C



  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134
    Try using VBTab.
    Jorge Ledo
    [email protected]
    Portugal were the sun allways shine... for programmers.

  3. #3
    Member 0pal_t0ad's Avatar
    Join Date
    Oct 2003
    Location
    Southampton,UK
    Posts
    63
    anyone know how to get them in line?
    eg

    tom B
    andrew A
    mark C

    ??
    thanks!
    When i write my code, there are only 2 ppl that understand it, me and God... a week later... God only knows
    (can't remember where i heard/read that)

  4. #4
    RTB.text = RTB.text & "Achmed" & vbtab & vbtab & "A"
    RTB.text = RTB.text & "CJ" & vbtab & vbtab & "B"
    RTB.text = RTB.text & "Synthia" & vbtab & vbtab & "C"

    etc. it will get in line

  5. #5
    Hyperactive Member
    Join Date
    Mar 2003
    Location
    Greece, Salonica
    Posts
    473
    Will this help
    VB Code:
    1. Dim strArray() As String
    2. strArray = Split(rtbMarks.Text, vbCrLf)
    3. rtbMarks.Text = ""
    4. Dim i            As Integer
    5. Dim strMark As String
    6. strMark = "A"
    7. For i = 0 To UBound(strArray)
    8. rtbMarks.Text = strArray(i) & "     " & strMark & vbCrLf
    9. Next i
    ?

  6. #6
    no mike it wont becuase the name lenght will differ

  7. #7
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    VB Code:
    1. RichTextBox1.Text = "Test" & Space(5) & "Test"

    The whole word SPACE() works.

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