Results 1 to 6 of 6

Thread: Multilined Rich Text Box . A question .

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258

    Post

    I have this code in button_click event
    Code:
    Dim strRTF As String, strFontName As String, lngFontColor As Long, lngFontSize As Long
      Dim blnBold As Boolean, blnUnderline As Boolean, blnItalic As Boolean
      
      'get font-styles so we can reset them later
      blnBold = RtbText.SelBold
      blnUnderline = RtbText.SelUnderline
      blnItalic = RtbText.SelItalic
      lngFontColor& = RtbText.SelColor
      lngFontSize& = RtbText.SelFontSize
      strFontName$ = RtbText.SelFontName
      
      strRTF$ = RtbText.TextRTF
      
      ''clear textbox
      RtbText.Text = ""
       
      ''reset font-styles
      RtbText.SelBold = blnBold
      RtbText.SelUnderline = blnUnderline
      RtbText.SelItalic = blnItalic
      RtbText.SelColor = lngFontColor&
      RtbText.SelFontSize = lngFontSize&
      RtbText.SelFontName = strFontName$
       
      ''show bottom half of textbox
      rtbChat.SelStart = Len(rtbChat.Text)
      rtbChat.SelLength = 0
      
      'print text in our rtbChat
      
      rtbChat.SelRTF = vbCrLf & strRTF$
      Debug.Print strRTF$
      
      'scroll rtbChat down
      rtbChat.SelStart = Len(rtbChat.Text)
      rtbChat.SelLength = 0
      
      'set focus
      RtbText.SetFocus
    The issue at hand here is when I type in the box again and click the button it justs adds the text it doesnt insert the equivelent of vbCrlf . How can I accomplish that ?

    Thanks for having a look ,
    []Private[]
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  2. #2
    Hyperactive Member dsy5's Avatar
    Join Date
    Jul 2000
    Location
    Lockport, NY
    Posts
    362
    Code:
    'print text in our rtbChat
                                          
    RTBChat.SelRTF = vbCrLf & strRTF$
    Debug.Print strRTF$
    
    'Add this code to your control here
    
    RTBChat.Text = RTBChat.Text + vbCrLf
    
    'scroll rtbChat down
    RTBChat.SelStart = Len(RTBChat.Text)
    RTBChat.SelLength = 0
    Donald Sy - VB (ab)user

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    I tried that and I end up with it the first line I type getting entered ,but the next line doesn't show and it reprints the first line skipping a space like this ;


    Test

    Test

    I hope I made that clear . anyother ideas ? What about a RTF code for a vbcrlf ?
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  4. #4
    Hyperactive Member dsy5's Avatar
    Join Date
    Jul 2000
    Location
    Lockport, NY
    Posts
    362
    Hmmm,

    I tried that code myself, and it worked fine!?!

    Let me copy your code again and try it...

    Get back to you later.
    Donald Sy - VB (ab)user

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    I must not be resetting something back then .
    Thanks for the confirmation . I must have issues elsewhere .
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  6. #6
    Hyperactive Member dsy5's Avatar
    Join Date
    Jul 2000
    Location
    Lockport, NY
    Posts
    362
    Yeah, you must be changing it in another part of your code - from the code you posted it works fine
    with the
    RTBChat.Text = RTBChat.Text + vbCrLf
    Donald Sy - VB (ab)user

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