|
-
Sep 23rd, 2000, 02:28 PM
#1
Thread Starter
Hyperactive Member
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 !!!!!
-
Sep 23rd, 2000, 05:05 PM
#2
Hyperactive Member
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
-
Sep 23rd, 2000, 06:21 PM
#3
Thread Starter
Hyperactive Member
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 !!!!!
-
Sep 23rd, 2000, 06:29 PM
#4
Hyperactive Member
Hmmm,
I tried that code myself, and it worked fine!?!
Let me copy your code again and try it...
Get back to you later.
-
Sep 23rd, 2000, 06:56 PM
#5
Thread Starter
Hyperactive Member
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 !!!!!
-
Sep 23rd, 2000, 07:56 PM
#6
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|