|
-
Mar 25th, 2005, 09:11 PM
#1
Thread Starter
Addicted Member
Color coding
Hrm... lol i wanna make it so that all the END's in a textbox turn red? any ideas how i could do that?
The Tempest Shall Never Die.
-
Mar 25th, 2005, 09:16 PM
#2
-
Mar 25th, 2005, 09:20 PM
#3
Thread Starter
Addicted Member
Re: Color coding
i have a richtextbox i got a color code thing by umm someone on the forum but its not working im tyring to change the word END to red but it don't work 
VB Code:
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
nStart = InStr(1, LCase(RichTextBox1.Text), sKeyword)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9)) Then
With RichTextBox1
.SelStart = nStart - 1
.SelLength = Len(sKeyword)
.SelColor = iColour
.SelText = StrConv(sKeyword, vbProperCase)
.SelStart = Len(RichTextBox1.Text)
.SelColor = iColour
End With
End If
nStart = InStr(nStart + Len(sKeyword), LCase(RichTextBox1.Text), sKeyword)
Loop
End Sub
Private Sub Form_Resize()
RichTextBox1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Private Sub RichTextBox1_Change()
With RichTextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SelColor = vbBlack
.SelStart = Len(.Text)
End With
' Add more custom words here
HighlightText "END", vbRed
End Sub
The Tempest Shall Never Die.
-
Mar 25th, 2005, 09:30 PM
#4
Need-a-life Member
-
Mar 25th, 2005, 09:33 PM
#5
Thread Starter
Addicted Member
Re: Color coding
kk lol but it goes lower case :\ i need it to stay upper
The Tempest Shall Never Die.
-
Mar 25th, 2005, 09:33 PM
#6
-
Mar 25th, 2005, 09:36 PM
#7
Thread Starter
Addicted Member
Re: Color coding
still puts End instead of END :\
The Tempest Shall Never Die.
-
Mar 25th, 2005, 09:57 PM
#8
Re: Color coding
thats impossible. try this then.
Option Explicit
Private Sub Form_Load()
Text1.Text = Replace(Text1.Text, "end", UCase("end"))
End Sub
-
Mar 25th, 2005, 10:10 PM
#9
Fanatic Member
Re: Color coding
you may want to check this link out for some tips on color coding:
color coding tips
-
Mar 25th, 2005, 10:15 PM
#10
Re: Color coding
How about
VB Code:
RichTextBox1.SelStart = 1 ' Check First time
do while RichTextBox1.SelStart > 0 ' do until not found anymore
If RichTextBox1.SelStart <> 1 then
RichTextbox1.SelStart + 3 ' Start at end of the last instance
endif
RichTextBox1.Find "END" ' search for "END"
if RichTextBox1.SelStart > 0 then ' if found
RichTextBox1.SelColor = iColor ' color it
endif
loop
EDIT: Changed to prevent endless loop.
Last edited by dglienna; Mar 26th, 2005 at 12:38 AM.
-
Mar 25th, 2005, 11:05 PM
#11
Need-a-life Member
Re: Color coding
The problem is the line that says StrConv(sKeyword, vbProperCase). ProperCase will change the first letter of the word to upper. Change the line
VB Code:
.SelText = StrConv(sKeyword, vbProperCase)
to
VB Code:
.SelText = sKeyword ' StrConv(sKeyword, vbProperCase)
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 25th, 2005, 11:20 PM
#12
Need-a-life Member
Re: Color coding
Based on dglienna's suggesed code (which won't work... sorry, dude)
VB Code:
Dim lStart As Long
Do
RichTextBox1.Find sKeyword, lStart ' search for "END"
If RichTextBox1.SelStart < lStart Then
'We found all the ocurrences!!
Exit Do
End If
If RichTextBox1.SelStart > 0 Then ' if found
RichTextBox1.SelColor = iColour ' color it
RichTextBox1.SelText = sKeyword
End If
lStart = RichTextBox1.SelStart + Len(sKeyword) + 1
Loop While RichTextBox1.SelStart > 0 ' do until not found anymore
However... this way you are not checking the previous and next character. Maybe you want to add this.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 25th, 2005, 11:29 PM
#13
Re: Color coding
I use this in my program. Whatever I search for is highlighted.
VB Code:
.SelStart = 0
.Find Trim(Line2)
.SelAlignment = rtfCenter
and this
VB Code:
.Find ("[47]")
.SelBold = 1
.SelText = Space(4) & "ESTIMATE ONLY"
so you could certainly use .Find, then .SelColor, then .SelText = "END",
but I don't think the replacement is even necessary, as shown in the first example. Whatever I .Find is selected. Whatever is selected is then Highlighted.
-
Mar 25th, 2005, 11:33 PM
#14
Need-a-life Member
Re: Color coding
 Originally Posted by dglienna
I use this in my program. Whatever I search for is highlighted.
VB Code:
.SelStart = 0
.Find Trim(Line2)
.SelAlignment = rtfCenter
and this
VB Code:
.Find ("[47]")
.SelBold = 1
.SelText = Space(4) & "ESTIMATE ONLY"
so you could certainly use .Find, then .SelColor, then .SelText = "END",
but I don't think the replacement is even necessary, as shown in the first example. Whatever I .Find is selected. Whatever is selected is then Highlighted.
The .SelText = "END" part is to change the text to uppercase (in case it was not in upper letters).
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 25th, 2005, 11:44 PM
#15
Re: Color coding
so why wouldn't the other code work, then? are you saying that it might have been 'end' in the text? then I agree. he didn't state that. as far as searching for "END" and changing the color, that would probably work, as other formatting operations work. I highlight variables that way using BOLD.
-
Mar 25th, 2005, 11:48 PM
#16
Need-a-life Member
Re: Color coding
 Originally Posted by dglienna
so why wouldn't the other code work, then? are you saying that it might have been 'end' in the text? then I agree. he didn't state that. as far as searching for "END" and changing the color, that would probably work, as other formatting operations work. I highlight variables that way using BOLD.
The code you posted first does not work because it never exit the loop. It keeps looking and finding the first occurence (which is the only word that's highlighted) and never exists the loop. You have to break the code and exit manually or just STOP the execution.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 12:13 AM
#17
Re: Color coding
Oh. I see now. I added that for multiple instances. You would have to stop resetting the start to .SelStart + 3 until SelStart = 0 (when it wasn't found)
-
Mar 26th, 2005, 12:20 AM
#18
Need-a-life Member
Re: Color coding
 Originally Posted by dglienna
Oh. I see now. I added that for multiple instances. You would have to stop resetting the start to .SelStart + 3 until SelStart = 0 (when it wasn't found)
The RichTextBox1.SelStart = 0 line was missing.
VB Code:
Dim lStart As Long
RichTextBox1.SelStart = 0 '<--- Actually... this is the only line that was missing
'(if no ocurrence is found)
Do
' RichTextBox1.SelStart = 0 ' Cannot set to 0. Otherwise, always the first word would be found
RichTextBox1.Find sKeyword, lStart ' search for "END"
If RichTextBox1.SelStart < lStart Then
'We found all the ocurrences!!
Exit Do
End If
If RichTextBox1.SelStart > 0 Then ' if found
RichTextBox1.SelColor = iColour ' color it
RichTextBox1.SelText = sKeyword
End If
lStart = RichTextBox1.SelStart + Len(sKeyword) + 1
Loop While RichTextBox1.SelStart > 0 ' do until not found anymore
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 08:25 AM
#19
Thread Starter
Addicted Member
Re: Color coding
OK.... lol so i got it so it stays in upper case but now i wanna make it so that if i have an If statement the whole thing turns blue like in this programming lang an if would look like(Wos scripting)
If T23, @hastoken23
(action if u don't got)
@hastoken23
(action if u got)
i wanna make it so that the If turns blue as well as the @hastoken23
The Tempest Shall Never Die.
-
Mar 26th, 2005, 08:28 AM
#20
Thread Starter
Addicted Member
Re: Color coding
aha ha :P i got it i just took out the
.SelStart = 0
from
richtextbox1_change()
thank you all ur the best
EDIT ok... ill give you an example of what it does now it puts
If T23, @hast23
in blue
but then i put an
END scene
and it turns END into red and scene is still in blue :\
EDIT again lol well now i took out
.SelLength = Len(.Text)
as well as
.SelStart = 0
and it seems to not do what it did before but now after i type a command
IF t23, @hast23 (in blue)
the action that i put will be in blue also :\
anyone know why?
Last edited by Tempestknight; Mar 26th, 2005 at 08:31 AM.
The Tempest Shall Never Die.
-
Mar 26th, 2005, 08:32 AM
#21
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
aha ha :P i got it i just took out the
.SelStart = 0
from
richtextbox1_change()
thank you all ur the best
EDIT ok... ill give you an example of what it does now it puts
If T23, @hast23
in blue
but then i put an
END scene
and it turns END into red and scene is still in blue :\
EDIT again lol well now i took out
.SelLength = Len(.Text)
as well as
.SelStart = 0
and it seems to not do what it did before but now after i type a command
IF t23, @hast23 (in blue)
the action that i put will be in blue also :\
anyone know why?
Can you post your code to test it?
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 08:38 AM
#22
Thread Starter
Addicted Member
Re: Color coding
Sure
VB Code:
Option Explicit
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
nStart = InStr(1, UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9) Or sNextChar = ".") Then
With RichTextBox1
.SelStart = nStart - 1
.SelLength = Len(sKeyword)
.SelColor = iColour
.SelText = sKeyword
.SelStart = Len(RichTextBox1.Text)
.SelColor = iColour
End With
End If
nStart = InStr(nStart + Len(sKeyword), UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Loop
End Sub
Private Sub RichTextBox1_Change()
With RichTextBox1
.SelStart = 0
.SelColor = vbBlack
.SelStart = Len(.Text)
End With
' Add more custom words here
HighlightText "END", vbRed
HighlightText "GOTO", vbYellow
HighlightText "IF", vbBlue
End Sub
thats what i got i want it to go back to black after i type say GOTO or IF or END...
The Tempest Shall Never Die.
-
Mar 26th, 2005, 08:55 AM
#23
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
Sure
VB Code:
Option Explicit
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
nStart = InStr(1, UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9) Or sNextChar = ".") Then
With RichTextBox1
.SelStart = nStart - 1
.SelLength = Len(sKeyword)
.SelColor = iColour
.SelText = sKeyword
.SelStart = Len(RichTextBox1.Text)
.SelColor = iColour
End With
End If
nStart = InStr(nStart + Len(sKeyword), UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Loop
End Sub
Private Sub RichTextBox1_Change()
With RichTextBox1
.SelStart = 0
.SelColor = vbBlack
.SelStart = Len(.Text)
End With
' Add more custom words here
HighlightText "END", vbRed
HighlightText "GOTO", vbYellow
HighlightText "IF", vbBlue
End Sub
thats what i got i want it to go back to black after i type say GOTO or IF or END...
It does a little flicker... but can't think of another solution without messing around too much with the code.
VB Code:
Option Explicit
Private Sub UnHighlightText(iColour As Long)
Dim iPos As Long
With RichTextBox1
iPos = .SelStart
.SelStart = 0
.SelLength = Len(.Text)
.SelColor = iColour
.SelStart = iPos - 1
End With
End Sub
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
Dim iPos As Long
nStart = InStr(1, UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9) Or sNextChar = ".") Then
With RichTextBox1
iPos = .SelStart
.SelStart = nStart - 1
.SelLength = Len(sKeyword)
.SelColor = iColour
.SelText = sKeyword
.SelStart = Len(RichTextBox1.Text)
.SelColor = iColour
.SelStart = iPos
End With
End If
nStart = InStr(nStart + Len(sKeyword), UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Loop
End Sub
Private Sub RichTextBox1_Change()
With RichTextBox1
.SelStart = 0
.SelColor = vbBlack
.SelStart = Len(.Text)
End With
' Add more custom words here
UnHighlightText vbBlack
HighlightText "END", vbRed
HighlightText "GOTO", vbYellow
HighlightText "IF", vbBlue
End Sub
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 09:01 AM
#24
Thread Starter
Addicted Member
Re: Color coding
if u test that u will see it ****s up
The Tempest Shall Never Die.
-
Mar 26th, 2005, 09:02 AM
#25
Thread Starter
Addicted Member
Re: Color coding
ok that still doesn't do what i want it to... it just keeps going same color like last time
The Tempest Shall Never Die.
-
Mar 26th, 2005, 09:05 AM
#26
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
ok that still doesn't do what i want it to... it just keeps going same color like last time
I don't understand what you need then. Can you posted the sample text you want COLORED, please??
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 09:09 AM
#27
Thread Starter
Addicted Member
Re: Color coding
ok lol... say if i have
IF T23, @hast23
ok i want that whole line blue but then if i i have
IF T23, @hast23
1: hey
i want IF T23, @hast23 to be blue and the 1: hey to be black
The Tempest Shall Never Die.
-
Mar 26th, 2005, 09:21 AM
#28
Need-a-life Member
Re: Color coding
So you want this:
IF T23, @hast23
1: hey
I think I deserve a couple of votes for all this help 
VB Code:
Option Explicit
Private Sub UnHighlightText(iColour As Long)
Dim iPos As Long
With RichTextBox1
iPos = .SelStart
.SelStart = 0
.SelLength = Len(.Text)
.SelColor = iColour
If iPos - 1 >= 0 Then
.SelStart = iPos - 1
End If
End With
End Sub
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
Dim iPos As Long
Dim sLine As String
nStart = InStr(1, UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9) Or sNextChar = ".") Then
With RichTextBox1
iPos = .SelStart
.SelStart = nStart - 1
sLine = Mid$(.Text, .SelStart + 1)
If InStr(sLine, vbCr) Then
sLine = Left$(sLine, InStr(sLine, vbCr) - 1)
End If
.SelLength = Len(sLine)
.SelColor = iColour
' .SelText = sKeyword
' .SelStart = Len(RichTextBox1.Text)
' .SelColor = iColour
.SelStart = iPos
End With
End If
nStart = InStr(nStart + Len(sKeyword), UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Loop
End Sub
Private Sub RichTextBox1_Change()
With RichTextBox1
.SelStart = 0
.SelColor = vbBlack
.SelStart = Len(.Text)
End With
' Add more custom words here
UnHighlightText vbBlack
HighlightText "END", vbRed
HighlightText "GOTO", vbYellow
HighlightText "IF", vbBlue
End Sub
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 09:37 AM
#29
Thread Starter
Addicted Member
Re: Color coding
OK lol that all works thank you. but now when u go and say u have
END
and u wanna change it to
END SCENE
u have it and u try to edit it but it brings you to next line. like u have
END
and add scene to it youll end up with
END S
CENE
because it brings you to next line know why? lol and yes i will vote for you :P lol i already gave u one yesterday
The Tempest Shall Never Die.
-
Mar 26th, 2005, 09:50 AM
#30
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
OK lol that all works thank you. but now when u go and say u have
END
and u wanna change it to
END SCENE
u have it and u try to edit it but it brings you to next line. like u have
END
and add scene to it youll end up with
END S
CENE
because it brings you to next line know why? lol and yes i will vote for you :P lol i already gave u one yesterday
HTH. I've helped you enough. You have the coloring thing working. All you need now is mess with the code to get it working like you want.... and I don't see you're grateful with the provided help.
VB Code:
Option Explicit
Private Sub UnHighlightText(iColour As Long)
Dim iPos As Long
With RichTextBox1
iPos = .SelStart
.SelStart = 0
.SelLength = Len(.Text)
.SelColor = iColour
If iPos - 1 >= 0 Then
.SelStart = iPos ' - 1
End If
End With
End Sub
Private Sub HighlightText(sKeyword As String, iColour As Long)
Dim nStart As Integer, sPrevChar As String, sNextChar As String
Dim iPos As Long
Dim sLine As String
nStart = InStr(1, UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Do While nStart <> 0
If nStart > 1 Then
sPrevChar = Mid$(RichTextBox1.Text, nStart - 1, 1)
Else
sPrevChar = " "
End If
If Len(RichTextBox1.Text) >= nStart + Len(sKeyword) Then
sNextChar = Mid$(RichTextBox1.Text, nStart + Len(sKeyword), 1)
Else
sNextChar = " "
End If
If (sPrevChar = Chr(32) Or sPrevChar = Chr(13) Or _
sPrevChar = Chr(10) Or sPrevChar = Chr(9)) And _
(sNextChar = Chr(32) Or sNextChar = Chr(13) Or _
sNextChar = Chr(10) Or sNextChar = Chr(9) Or sNextChar = ".") Then
With RichTextBox1
iPos = .SelStart
.SelStart = nStart - 1
sLine = Mid$(.Text, .SelStart + 1)
If InStr(sLine, vbCr) Then
sLine = Left$(sLine, InStr(sLine, vbCr) - 1)
End If
.SelLength = Len(sLine)
.SelColor = iColour
' .SelText = sKeyword
' .SelStart = Len(RichTextBox1.Text)
' .SelColor = iColour
.SelStart = iPos
End With
End If
nStart = InStr(nStart + Len(sKeyword), UCase(RichTextBox1.Text), sKeyword, vbTextCompare)
Loop
End Sub
Private Sub RichTextBox1_Change()
' Add more custom words here
UnHighlightText vbBlack
HighlightText "END", vbRed
HighlightText "GOTO", vbYellow
HighlightText "IF", vbBlue
End Sub
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 09:58 AM
#31
Thread Starter
Addicted Member
Re: Color coding
lol i am very grateful lol.Its kinda hard to express feeling on a forum :\ lol u know. I always fiddle around with the code provided before asking questions. As well as search before i ask.... lol but thank you
The Tempest Shall Never Die.
-
Mar 26th, 2005, 10:02 AM
#32
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
lol i am very grateful lol.Its kinda hard to express feeling on a forum :\ lol u know. I always fiddle around with the code provided before asking questions. As well as search before i ask.... lol but thank you 
If you read my signature you'll know what I mean.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 10:09 AM
#33
Thread Starter
Addicted Member
Re: Color coding
Lol ill remember that but i try to give you a point it says
You must spread some Reputation around before giving it to Mc Brain again.
so as soon as i get a chance ill give you a point
The Tempest Shall Never Die.
-
Mar 26th, 2005, 10:13 AM
#34
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
Lol ill remember that  but i try to give you a point it says
You must spread some Reputation around before giving it to Mc Brain again.
so as soon as i get a chance ill give you a point 
Sorry about that.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 01:17 PM
#35
Thread Starter
Addicted Member
Re: Color coding
I feel realy bad asking this sinse u helped me so much but can anyone direct me to a link with all the built in VB colors?
The Tempest Shall Never Die.
-
Mar 26th, 2005, 01:29 PM
#36
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
I feel realy bad asking this sinse u helped me so much but can anyone direct me to a link with all the built in VB colors?
I don't understand what you need.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 01:30 PM
#37
Thread Starter
Addicted Member
Re: Color coding
lol like vbYellow vbRed vbBlue i dunno them all is there a website(i tired looking) where there is a list of em?
The Tempest Shall Never Die.
-
Mar 26th, 2005, 01:42 PM
#38
Need-a-life Member
Re: Color coding
 Originally Posted by Tempestknight
lol like vbYellow vbRed vbBlue i dunno them all is there a website(i tired looking) where there is a list of em?
Here's MSDN's text...
 Originally Posted by MSDN
Color Constants
Colors
Constant Value Description
vbBlack &H0 Black
vbRed &HFF Red
vbGreen &HFF00 Green
vbYellow &HFFFF Yellow
vbBlue &HFF0000 Blue
vbMagenta &HFF00FF Magenta
vbCyan &HFFFF00 Cyan
vbWhite &HFFFFFF White
System Colors
Constant Value Description
vbScrollBars &H80000000 Scroll bar color
vbDesktop &H80000001 Desktop color
vbActiveTitleBar &H80000002 Color of the title bar for the active window
vbInactiveTitleBar &H80000003 Color of the title bar for the inactive window
vbMenuBar &H80000004 Menu background color
vbWindowBackground &H80000005 Window background color
vbWindowFrame &H80000006 Window frame color
vbMenuText &H80000007 Color of text on menus
vbWindowText &H80000008 Color of text in windows
vbTitleBarText &H80000009 Color of text in caption, size box, and scroll arrow
vbActiveBorder &H8000000A Border color of active window
vbInactiveBorder &H8000000B Border color of inactive window
vbApplicationWorkspace &H8000000C Background color of multiple-document interface (MDI) applications
vbHighlight &H8000000D Background color of items selected in a control
vbHighlightText &H8000000E Text color of items selected in a control
vbButtonFace &H8000000F Color of shading on the face of command buttons
vbButtonShadow &H80000010 Color of shading on the edge of command buttons
vbGrayText &H80000011 Grayed (disabled) text
vbButtonText &H80000012 Text color on push buttons
vbInactiveCaptionText &H80000013 Color of text in an inactive caption
vb3DHighlight &H80000014 Highlight color for 3D display elements
vb3DDKShadow &H80000015 Darkest shadow color for 3D display elements
vb3DLight &H80000016 Second lightest of the 3D colors after vb3Dhighlight
vb3DFace &H8000000F Color of text face
vb3Dshadow &H80000010 Color of text shadow
vbInfoText &H80000017 Color of text in ToolTips
vbInfoBackground &H80000018 Background color of ToolTips
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Mar 26th, 2005, 01:43 PM
#39
Thread Starter
Addicted Member
Re: Color coding
Thanks
The Tempest Shall Never Die.
-
Mar 26th, 2005, 01:48 PM
#40
Need-a-life Member
Re: Color coding
You might also want to have a look at thr RGB function
 Originally Posted by MSDN
RGB Function
Returns aLong whole number representing an RGB color value.
Syntax
RGB(red, green, blue)
The RGB function syntax has thesenamed arguments:
Part Description
red Required; Variant (Integer). Number in the range 0–255, inclusive, that represents the red component of the color.
green Required; Variant (Integer). Number in the range 0–255, inclusive, that represents the green component of the color.
blue Required; Variant (Integer). Number in the range 0–255, inclusive, that represents the blue component of the color.
Remarks
Applicationmethods andproperties that accept a color specification expect that specification to be a number representing an RGB color value. An RGB color value specifies the relative intensity of red, green, and blue to cause a specific color to be displayed.
The value for anyargument to RGB that exceeds 255 is assumed to be 255.
The following table lists some standard colors and the red, green, and blue values they include:
Color Red Value Green Value Blue Value
Black 0 0 0
Blue 0 0 255
Green 0 255 0
Cyan 0 255 255
Red 255 0 0
Magenta 255 0 255
Yellow 255 255 0
White 255 255 255
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
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
|