ChatSend with Text Color Format

You can talk about VB programming here

ChatSend with Text Color Format

Postby Johnny5 » Fri Apr 01, 2005 10:28 pm


How can you send text to room with color formated?
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby UDG_Sk8erboi4490 » Fri Apr 01, 2005 10:40 pm

lol, use a richtextbox, put in the writing u want in the text box, then put ricktextbox1.selcolor = vbred, vbblue, vbgreen or what ever color u want
UDG_Sk8erboi4490
imFiles Senior
imFiles Senior
 
Posts: 112
Joined: Fri Apr 01, 2005 10:36 pm

Postby Johnny5 » Fri Apr 01, 2005 11:36 pm

:) thank you i'll try that
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby locohacker » Sat Apr 02, 2005 12:16 am

Yeps, you can do that or add CommonDialog

like go to projects then components there select microsoft common dialog controls 6.0 then u ad CommonDialog to the form and call it like this on a command button

Code: Select all
CommonDialog1.ShowColor
RichTextBox1.SelColor = CommonDialog1.Color


I think is better cause u can select all the colors like thar :D
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby UDG_Sk8erboi4490 » Sat Apr 02, 2005 12:21 am

sometimes it dunw ork right, like till chatsend one time, then it turns back to black
UDG_Sk8erboi4490
imFiles Senior
imFiles Senior
 
Posts: 112
Joined: Fri Apr 01, 2005 10:36 pm

Postby locohacker » Sat Apr 02, 2005 12:28 am

Damn that suks, :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby UDG_Sk8erboi4490 » Sat Apr 02, 2005 12:53 am

yah, thats why i never released simple age checker with that option, tested it but never worked
UDG_Sk8erboi4490
imFiles Senior
imFiles Senior
 
Posts: 112
Joined: Fri Apr 01, 2005 10:36 pm

Postby Johnny5 » Sat Apr 02, 2005 2:49 am

'**************************************************************************
'USAGE:
' ColorWord ("blue"), vbBlue, 10, True, False
' ColorWord ("red"), vbRed, 10, True, False
' ColorWord ("cyan"), vbCyan, 10, True, False
' ColorWord ("green"), vbGreen, 10, True, False
' ColorWord ("magenta"), vbMagenta, 10, True, False
' ColorWord ("yellow"), vbYellow, 10, True, False
'**************************************************************************

Public Function ColorWord(Swords As String, Scolor As ColorConstants, _
SFontsize As Integer, Sbold As Boolean, Sitalic As Boolean)
Dim search&
search = 1
Do Until search = 0
search = InStr(search, frmRTB.rtb.text, Swords, vbTextCompare)
If search > 0 Then
With frmRTB.rtb
.SelStart = search - 1
.SelLength = Len(Swords)
.SelColor = Scolor
.SelFontSize = SFontsize
.SelBold = Sbold
.SelItalic = Sitalic
End With
search = search + Len(Swords)
End If
Loop
With frmRTB.rtb
.SelStart = Len(frmRTB.rtb.text)
.SelColor = vbGreen
.SelFontSize = 8
.SelBold = False
.SelItalic = False
End With
End Function
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Johnny5 » Sat Apr 02, 2005 2:51 am

for the above function
if you want to change color on a certain words in the RTB then use the line

ColorWord ("THIS WORDS IS YELLOW, FONT SIZE 10, BOLD IS TRUE, ITALLIC IS FALSE"), vbYellow, 10, True, False
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Johnny5 » Sat Apr 02, 2005 2:52 am

This will send the content of RichTextBox1 Control to paltalk with chatsend function
call chatsend(RichTextBox1)
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Johnny5 » Sun Apr 03, 2005 1:14 am

UDG_Sk8erboi4490 wrote:lol, use a richtextbox, put in the writing u want in the text box, then put ricktextbox1.selcolor = vbred, vbblue, vbgreen or what ever color u want


I able to get all the words in dif. color but when send to room it wont display and give msg:

Paltalk: Message was not sent. The message was too long or contained non printable characters.

why is this happen?

the text lenght just about 100 char. not that long, it this related to vbCrLf ?
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby locohacker » Sun Apr 03, 2005 2:37 am

i had the same problem with the prankster, does the rtf box look like a space before the text or a line before the text

another thing is it a fader :)
User avatar
locohacker
Site Admin
Site Admin
 
Posts: 4361
Joined: Fri Dec 31, 2004 6:59 pm

Postby UDG_Sk8erboi4490 » Sun Apr 03, 2005 12:46 pm

well im thunking they added coding, try putting the richtextbox1.selcolor = red or whatever in forum_load() see if that fixed it, when its in the command line it probably fucks upthe coding that they had and prints the hex varaibles for the colors and everything
UDG_Sk8erboi4490
imFiles Senior
imFiles Senior
 
Posts: 112
Joined: Fri Apr 01, 2005 10:36 pm

Postby Johnny5 » Sun Apr 03, 2005 4:35 pm

so! UDG should we use hex color code instead of vbblue, vbgreen, stuff? cause i've test the basic of color

Private Sub colorizeFont()
r = 255 * Rnd
g = 255 * Rnd
b = 255 * Rnd
RichTextBox1.SelColor = RGB(r, g, b)
End Sub

Private Sub RichTextBox1_Change()
DoEvents
colorizeFont
Me.Caption = "(Fun_Font) = Font Color (" & RichTextBox1.SelColor & ")"
DoEvents
End Sub

the above 2 line will change color in RTBox every time entered a key, then use a command button to sent to paltalk

i've test 1 word about 15 chars after that i't won't display in PT
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby UDG_Sk8erboi4490 » Sun Apr 03, 2005 6:01 pm

well, i suggest u put richtextbox1.selcolor = xxooox or vbred in form_load instead of module liek is aid b4, see if that works, then i would just mess with randomize colors to see if that works instead of one basic color, cause its like the text fader problem we had, less then 2 colors wouldnt send right, may be the same thing for this
UDG_Sk8erboi4490
imFiles Senior
imFiles Senior
 
Posts: 112
Joined: Fri Apr 01, 2005 10:36 pm

Next

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests