|
-
Jul 31st, 2002, 05:08 AM
#1
Thread Starter
PowerPoster
Colour Weirdness.
In my chat Program, it has the ability to send coloured messages.
So when a user sends a Message it would look like this
User1: Message, in black maybe....
User2: A message in red
At this stage all works well, but then .... 
User1: Oh my god, my username is now the colour that appeared above.
Now this is definately not good. Anyways, I have little idea whats going on, so I've posted the full app on the forums, in the thread "Convert This App to VBA".
Anyway, heres some sections that I think might be reasponsible
VB Code:
'Found in the Toolbar, with messagelogtxt being the Sent Messages
'cdFont = CommonDialogBox
'messagetxt = Messages entered here.
Case "Font"
On Error Resume Next
cdFont.Flags = cdlCFBoth
cdFont.FontName = messageLogTXT.Font.Name
cdFont.FontSize = messageLogTXT.Font.Size
cdFont.FontBold = messageLogTXT.Font.Bold
cdFont.FontItalic = messageLogTXT.Font.Italic
cdFont.ShowFont
With cdFont
If .FontSize < 8 Then
messageTXT.Font.Name = .FontName
messageTXT.Font.Size = .FontSize
messageTXT.Font.Bold = .FontBold
messageTXT.Font.Italic = .FontItalic
Else
Exit Sub
End If
End With
Private Sub sendBTN_Click()
On Error Resume Next
Dim tempCommand As command
If Len(messageTXT.Text) > 300 Then
Exit Sub
End If
If Len(messageTXT.Text) = 0 Then
Exit Sub
End If
tempCommand.type = "MSG"
tempCommand.fromIP = getCurrentIP
messageTXT.SelStart = 0
messageTXT.SelLength = Len(messageTXT.Text)
tempCommand.value = messageTXT.SelRTF
sendMessageToSelectedUsers tempCommand
' For x = 0 To contactList.Count - 1
'
' If contactList(x).sendTo Then
'
' sendCommand_MessageSocket tempCommand, contactList(x).IP
'
' End If
'
' Next x
messageTXT.Text = ""
End Sub
Does anything there look abit dodge??
Thanks in Advance.
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
|