Ok i just started trying to make a little bot... i used the richtx32.ocx to get a box where i can use different colors, but i cant find any site where its really good explained how to use colors. Everytime if i maybe found a way to use colors i get errors...
an example:
Writing the line then searching for it, selecting it and changing its color....
or
Setting a color, then writing the line...
nothing works for me, or i just use this code wrong,,,
can some1 give me a real easy example of a working color code?
Public Function AddChat(ByVal RTB as RichTextBox, ParamArray Blub() As Variant)
Dim i As Integer
With RTB
.SelStart = 99999999
.SelLength = 0
.SelColor = vbWhite
.SelText = "[" & Time & "] "
.SelStart = 99999999
End With
For i = LBound(Blub) To UBound(Blub) Step 2
With RTB
.SelStart = 99999999
.SelLength = 0
.SelColor = Blub(i)
.SelText = Blub(i + 1) & Left$(vbCrLf, -2 * CLng((i + 1) = UBound(Blub)))
.SelStart = 99999999
End With
Next i
End Function
Sample Usage:
AddChat frmMain.rtbChat, vbYellow, "Welcome!"
More than one color?
AddChat frmMain.rtbChat, vbYellow, "w", vbGreen, "e", vbYellow, "l", vbGreen, "c", vbYellow, "o", vbGreen, "m", vbYellow, "e", vbBlue, "!"
uh fast reply, thanks a lot!
im going to test that now...
Quote from: DarkSoldier on August 20, 2004, 03:35 PM
uh fast reply, thanks a lot!
im going to test that now...
Well?
Can anyone provide a RichText Box tutorial really quick? Just things like making part of a line bold and the next not or maybe even the whole line. Something simple to understand and use, so I can italize as well.
ok, tested it and modified it a little bit, works fine!
Quote from: Networks on August 20, 2004, 05:27 PM
Can anyone provide a RichText Box tutorial really quick? Just things like making part of a line bold and the next not or maybe even the whole line. Something simple to understand and use, so I can italize as well.
.SelBold = True
.SelItalic = True
It's not that hard....
Quote from: R.a.B.B.i.T on August 24, 2004, 05:25 PM
Quote from: Networks on August 20, 2004, 05:27 PM
Can anyone provide a RichText Box tutorial really quick? Just things like making part of a line bold and the next not or maybe even the whole line. Something simple to understand and use, so I can italize as well.
.SelBold = True
.SelItalic = True
It's not that hard....
Wow.. it really isn't. Anyway thanks :)
You can do what I've done and create a rich text generator. It's not that bad once you've figured out the general syntax and formatting rules. :)