• Welcome to Valhalla Legends Archive.
 

Help with color things

Started by EviL_MarinE, October 24, 2004, 01:26 PM

Previous topic - Next topic

EviL_MarinE

Hey, i want to do:


       If Left(Text1.Text, 1) <> "/" Then Display ChatRoom, True, True, vbCyan, "<" & frmLogin.txtUsername & "> " & vbWhite, Text1.Text


But i get the error:
"Wrong number of  Arguements Or invalid Property Assigment"

I think its to do with the Display function and im not saying for it to do 2 colours, well heres my display function:


Public Function Display(ByVal TextObject As RichTextBox, ByVal NewLine As Boolean, ByVal TimeStamp As Boolean, ByVal TextColor As Long, ByVal Text As String)

    TextObject.SelStart = Len(TextObject.Text)
       
    If NewLine = True And TextObject.Text <> "" Then TextObject.SelText = TextObject.SelText & vbCrLf
       
    If TimeStamp = True Then
       
        TextObject.SelColor = &H8000000F
        TextObject.SelText = TextObject.SelText & "=[" & Time & "]= "
           
    End If
       
    TextObject.SelColor = TextColor
    TextObject.SelText = TextObject.SelText & Text
    TextObject.SelStart = Len(TextObject.Text)
   
End Function



If any1 could reply with what i shud add to let it do 2 colours in one line, i will great thank them!

shadypalm88

Quote from: EviL_MarinE on October 24, 2004, 01:26 PM
QuoteIf Left(Text1.Text, 1) <> "/" Then Display ChatRoom, True, True, vbCyan, "<" & frmLogin.txtUsername & "> " & vbWhite, Text1.Text
You can't do that with yours.  You're displaying the person's username and the code for the color white in cyan, and then an extra argument (that has no place to go) containing the text.  You'll need to do:
If Left(Text1.Text, 1) <> "/" Then
    Display ChatRoom, True, True, vbCyan, "<" & frmLogin.txtUsername & "> "
    Display ChatRoom, False, False, vbWhite, Text1.Text
End If

EviL_MarinE

Wowoowowow thanks it worked
love ya dude ;)