|
-
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.
-
Jul 31st, 2002, 12:21 PM
#2
Hyperactive Member
Is there any other piece of code where the Font attributes are changed?
I don't see there the part of the code that stores the previos settings of the Font (the one used to display de Name)
Or maybe that's what is missing...the save Name displayed Font settings...you know what I mean?
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Jul 31st, 2002, 12:26 PM
#3
The picture isn't missing
what you need to do is reset the color to black, since the color carries over from the RED text you made before. just do something like rTF.SelText = vbBlack, or whatever.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
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
|