|
-
Jun 15th, 2002, 07:38 AM
#1
Thread Starter
New Member
-
Jun 15th, 2002, 07:47 AM
#2
Lively Member
add rich text box call it rich1
and use the code
rich1.SelColor = vbRed
rich1.SelText = "red text" + vbNewLine
for red
and
rich1.SelColor = vbBlack
rich1.SelText = "blacktext" + vbNewLine
hope ive helped
-
Jun 15th, 2002, 07:52 AM
#3
Thread Starter
New Member
is there a difference between a rich text box and a regular one?
Also, my boss just wants the two text boxes that I already have. He wants the text in the byte arrays to turn red. Is that even possible?
-
Jun 15th, 2002, 07:56 AM
#4
Lively Member
rich text box can display multiple colors and textbox can only one forecolor...
if you wont change the textboxes you use to richtextbox, you cant use multiple color.
-
Jun 15th, 2002, 08:00 AM
#5
Thread Starter
New Member
How do I change the text box I have now to a rich text box?
-
Jun 15th, 2002, 08:01 AM
#6
Originally posted by JenniGE
Also, my boss just wants the two text boxes that I already have. He wants the text in the byte arrays to turn red. Is that even possible?
Usage of the RTB may add a bit to the overall size of the project, but based upon the criteria he's given you, it's your best choice. You might also want to go for several labels... a little hectic, but can do the thing you want it to.
-
Jun 15th, 2002, 08:12 AM
#7
Junior Member
try this
You can change forecolor of textboxes. Maybe this isnt what you wanted but if it is it works fine with textboxes.
i did it with a command button but you could put it in one of the textboxes validate commands as well i think.
VB Code:
Private Sub Command1_Click()
If Text1 = Text2 Then
Text1.ForeColor = vbRed
Text2.ForeColor = vbRed
Else
Text1.ForeColor = black
Text2.ForeColor = black
End If
End Sub
-
Jun 15th, 2002, 08:12 AM
#8
Lively Member
to replace the existing textboxes with Richtextboxes
just right click on the toolbar select components then select the richtextbox from the list
add the richtextbox to the form and change the name to the same name as the textbox, then instead of using text1.text=text1.text+"..."
use text1.seltext="..."
(text1.text="..." will cause you to display only in one color)
-
Jun 15th, 2002, 08:15 AM
#9
Lively Member
rjcarroll , using the button you gave will cuase the whole textbox to display the same color (red or black) and he wanted to display some of the lines as black and some of them as red in the same textbox...
richtextbox is the solution.
-
Jun 15th, 2002, 09:11 AM
#10
Junior Member
sound good to me
thanks mrfixit. like i said " may not be what he wants (but)"
i didnt realize he was using multilines. thought he was showing just one result in text1 and 2 at a time.
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
|