Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Coloring Pivotfield.item


Hi guys,

I would like to prepare code which will color pivotfield.pivotitem.labelrange. So far I have prepared the following code:



VB Code:
Dim pvtfield As PivotFieldDim pvtitem As PivotItemsSet pvtfield = ActiveSheet.PivotTables("PivotTable9").PivotFields("year2_sk")For Each pvtitem In pvtfieldpvtitem.LabelRange.Interior.ColorIndex = 24Next


When I run this code it giving me back the 438 error code and highlights me the 4th line.
Can anybody tell me what is wrong?

Thanks. Boris


I have changed to this and it works:


VB Code:
Dim pvtfield As PivotFieldDim pvtitem As PivotItemDim i, jSet pvtfield = ActiveSheet.PivotTables("PivotTable9").PivotFields("year2_sk")i = pvtfield.PivotItems.CountFor j = 1 To i  pvtfield.PivotItems(j).LabelRange.Interior.ColorIndex = 24  pvtfield.PivotItems(j).LabelRange.Font.Bold = True  pvtfield.PivotItems(j).LabelRange.HorizontalAlignment = xlCenterNext j




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving To The Next Item In A Pivotfield
I have some code which runs in this For loop.


Code:
For Each PivotItem In ActiveSheet.PivotTables("PivotTable1").PivotFields("Questions").PivotItems
Sheets("Pivot Table").Select
Range("A4").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Chart Data").Select
ActiveCell.Select
ActiveSheet.Paste
Sheets("Pivot Table").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("Chart Data").Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
ActiveCell.Offset(3, 0).Select

Next

The item "Questions" is in the page field at the top.

I'd like the code to move to the next item in the page field, and perform the code.

Any idea how it's done?

PivotField Selection Problems!!!
Hi all,

Can anyone help. I have this code to create a pivot table on a seperate sheet in my workbook. The problem is i want to be able to change the pivotfield ranges below by being able to correspond to a point on the worksheet i.e. activecellranger1c1 or cell A1..etc.. At the moment if iwant to change the datafield and row field it is manually done in VB Editor.

Thanks!!!

Code:
ActiveCell.FormulaR1C1 = "I want this to appear"


.PivotFields Range("I want this to appear !!!HERE!!!").Orientation = xlDataField
.PivotFields Range("I want this to appear !!!HERE").Orientation = xlRowField


Sub CreatePivotTable()
Dim PTCache As PivotCache
Dim PT As PivotTable

On Error Resume Next
Application.DisplayAlerts = False
Sheets("Summary").Delete
On Error GoTo 0

Set PTCache = ActiveWorkbook.PivotCaches.Add _
(SourceType:=xlDatabase, _
SourceData:="Source Data!R1C1:R3000C20") _

Worksheets.Add
ActiveSheet.Name = "Summary"
ActiveCell.FormulaR1C1 = "I want this to appear"


Set PT = PTCache.CreatePivotTable _
(TableDestination:=Sheets("Summary").Range("b22"), _
TableName:="PivotTable1")
ActiveWindow.Zoom = 75
ActiveWindow.DisplayGridlines = False

With PT
.PivotFields Range("I want this to appear !!!HERE!!!").Orientation = xlDataField
.PivotFields Range("I want this to appear !!!HERE").Orientation = xlRowField
.PivotFields("Function").Orientation = xlPageField
.PivotFields("Location").Orientation = xlPageField


End With


End Sub

PivotField Text Limit
Does anyone know if there is any way to view more than 255 characters in a pivot table field?

i have created a database in excel for users to write comments, which are then viewed/sorted via a pivot table. The problem is that some people have written entries with more than 255 characters. Excel is truncating the entries in the pivot table results, although the full text is still in the original spreadsheet.
Is there a default that I can change, or is it a limitation of the Pivot table?

Pivot Table; Loop Through PivotField Values
I’m new to this, but I’ll give it a shot. I’m trying to create a macro that will look at a list and iterate all of the values through a PivotField. I can get this to work if I write the specific value needed in the PivotField into the macro, but not a way to cycle through all of the values without naming them.

For example, a PivotField "NEW_USED" with 2 values "New" and "Used":

Sheets("Amort").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("NEW_USED").Current Page = _
"NEW"
ActiveSheet.PivotTables("PivotTable1").PivotFields("NEW_USED").Current Page = _
"USED"

Any help would be appreciated.

How To Search Listbox For Item If Item Not Found Add Item?
Hi, lol man I cant find nothing today when I search the forum.

This my latest problem, How do I search a listbox for an item lets say "Game Over" And if the item is found the program does nothing, but if the item is not found it will add "Game Over"

Thanks Again

More RTB Coloring !
Hi orufet, I found this code by you :


Code:
'color all of the text inside brackets blue
txtMain.SelStart = 0 'cursor at the beginning of the file
Do Until NewPos >= Len(txtMain.Text) 'loop to color everthing
BeginBracket = txtMain.Find("<", NewPos) 'find the left bracket
'MsgBox BeginBracket
EndBracket = txtMain.Find(">", NewPos) 'find the right bracket
'MsgBox EndBracket
txtMain.SelStart = BeginBracket 'start the selection at the first bracket
txtMain.SelLength = (EndBracket - BeginBracket) + 1 'end the selection at the last bracket
NewPos = (txtMain.SelLength + txtMain.SelStart) + 1
txtMain.SelColor = &H800000
Loop
I found this code here :
http://www.xtremevbtalk.com/show...threadid=17132


I tried to put it in my program and I can't get it to work.
Could somebody point out to me if there is something missing (Error Catch .etc).

Thanks for any help

RTB Coloring
This is what I am getting

<HTML>

Using this Code

Code:
If KeyCode = 188 Then '<
RTB.SelColor = vbGreen
RTB.SelBold = True
End If
If KeyCode = 190 Then '>
RTB.SelColor = vbBlack
RTB.SelBold = False
End If
This is what I am trying to get :
<HTML>


Thanks for any HELP.

More RTB Coloring !
From: http://www.xtremevbtalk.com/t32062.html

Quote:Originally Posted by chris00Hi orufet

Thanks for the code.

Its easy to read. Which mine isn't.

Thanks for the great code.


Hi All
I used the code above from Orufet whick works really well. I placed the code within the RTB.
The only problem I am running into is typing in real time. The cursor always returns to position "0" evertime. Is there a way around this?

Thanks
Lee.

Coloring RTB
ok i want to color some words like in the VB IDE.
can anyone show me a very fast example.
also how do i get current line of RTB?

RTB Coloring
hi there

i have read a tutorial on the basics of RTB coloring. i basically want to be able to color some keywords entered in the RTB if we load a file and if we enter text into the RTB.

how do i go about doing this? i am really sorry - perhaps a stupid question but i would love to know how to apply it.

Thanks

Coloring
Is any way for coloring any column in dbgrid?
Thanks for help.

Row Coloring
For the question I have I will use the following illustration :
Microsoft Outlook (97) Tasks folder – the View include several columns and the rows are shown in different color –red if the Due Date passed etc.
Can I implement this kind of view in VB thus the color of each row will be different due to some conditions –
thus Due date passed or status completed .
What kind of Control/s should I use for this ?

Smooth Coloring
Hi there!

Well guys my question in very specific and I actually have little hopes for someone answer it. You see I am working on a project generating the Mandelbrot set. The project is fairly complete but I 'm facing a problem I cannot find any answer. I am coloring the set using this formula:

Form1.Pset(x,y), thecolor(num_of_iterations Mod 255)

To explain myself a little bit, thecolor() is a table containing 255 colors, x,y are the pixels' position (the set is drawned on a form) and the num_of_iterations is the number of iterations (wow!). The problem is that the image colors look "scaled". Is there any coloring method suggestions for making the set colors smoother?

I'll appreciate any suggestions.

Coloring An Image Through VB
Hello,

I have two relating questions regarding images --

1) Is there a way I can filter out all but a certain color (Black, in this case), and fill it with white?

2) If not, is there a way I can fill a selected color with another color?

Thanks

Coloring Base On Max
Hi I need to go through some areas and color the three highest values in the area.

I thought this would work but I can't the max property of the worksheetclass


Code:
Sub formater_tot()
Dim tot_rng As Areas, cell As Range

Set tot_rng = Range("B3:B50,E3:E50,H3:H50,K3:k50,N3:N50,Q3:Q50,T2:T50").Areas
For Each cell In tot_rng
If cell.Value = WorksheetFunction.Max(tot_rng) Then
cell.ColorIndex = 6
End If
Next cell


End Sub

any help is geatly appreciated.

Coloring A Cell
please guys i need some help, i think it a very simple question,
i'm using vb ang accessing an excel file.. now my problem is how
do i chnage the cell color of a particular cell in excel...
for example i want to fill the cell with a color red.
thank you guys in advance.....

Flexgrid Coloring
is it possible to sent the background of ALL the cells except the non editable ones to a single color with just 1 command?

Cell Coloring
I'm hoping I can do this with a formula, and I don't need a macro, but this is what I'm looking to do:

I would like a cell to change colours based on what number is in a cell

IE:
If Value is less than 100, make cell blue
If value is 100 to 1000 make it green
if value is 1000 to 2000 make it purple
and if value is over 2000 make it red

Is this possible?

Thank you very much for any help in advance.

Coloring A Cell
please guys i need some help, i think it a very simple question,
i'm using vb ang accessing an excel file.. now my problem is how
do i chnage the cell color of a particular cell in excel...
for example i want to fill the cell with a color red.
thank you guys in advance.....

Coloring Listview
Hi folks,

i have this listview in report layout. I want that my last column will be colored green how can i do this? is this even possible?

Retaining RTF Coloring
In a Rich text box I'm using the following to chop that last 500 characters off the top of the RTB when it reaches 2000 characters long.
If Len(HostForm.rtfRX(index).text) > lMaxLen Then
HostForm.rtfRX(index).text = Right$(HostForm.rtfRX(index).text, lMaxLen - 500)
End If

In the RTB some words have been colored different colors. When the above line executes it wipes all of the Coloring out of the RTB.

How can I accomplish this task and still maintain color formatting????


Rick

Coloring Controls
Hi

I am trying to change the Fore Color of every control in my form :



were am I going wrong.


Code:
Dim ctl As Control
CommonDialog1.ShowColor

BC = CommonDialog1.color
For Each ctl In Me.Controls
ctl.ForeColor = BC
Next ctl
Thanks for any HELP

ListView Coloring :o)
Hey all i am trying to color some items in my listview if a "YES" appears in the database for each item.

I have attached a picture of my listview so that you can see what i am talking about. In the picuture, the item named "fsadfsdf sdfsadf" is the only one that should be colored out of the 4 that are listed.

I am, however, unable to do this. This is my code to populate the listview:

Code:
Private Sub Form_Load()
PopulatePassCombo
With LV1
.ColumnHeaders.Add , , "Guest Name", 2700
.ColumnHeaders.Add , , "Pick-Up Time", 1800
.ColumnHeaders.Add , , " QTY | Order(s)", 5550
.ColumnHeaders.Add , , "Notes", 12000
.ColumnHeaders.Add , , "Phone #", 1300
.ColumnHeaders.Add , , "Address", 10000
.ColumnHeaders.Add , , "ID", 0
.View = lvwReport
End With
AddPTO
End Sub

Private Sub AddPTO()
Dim strSQL As String, intEntryCount As Integer
Dim mItem As ListItem, strKey As String
Dim strTime, strPickUp As String
Dim strOrder, strToDay As String
Dim strNotes, strNoItem As String

strToDay = Format(Now, "ddd mm/dd/yyyy")
strNoItem = "====No Item Selected===="

Open_Database
strSQL = "SELECT * FROM PartyTrayOrders WHERE PickUp = '" & strToDay & "' ORDER BY AMPM,TimeH,TimeM"
Set rst = New ADODB.Recordset
With rst
.Source = strSQL
.ActiveConnection = conn
.LockType = adLockReadOnly
.Open
Do Until .EOF
intEntryCount = intEntryCount + 1
strKey = Format(intEntryCount, "00")
Set mItem = LV1.ListItems.Add(, , strKey)
mItem.Text = !NameFirst & " " & !NameLast
strPickUp = !PickUp
lblPickUp = !PickUp
strTime = !TimeH & ":" & !TimeM & " " & !AMPM
strOrder = !Qty1 & " > " & !Item1
strNotes = !Notes
strNotes = Replace(strNotes, vbCrLf, " ")
mItem.SubItems(1) = strTime
mItem.SubItems(2) = strOrder
mItem.SubItems(3) = strNotes
mItem.SubItems(4) = !Phone
mItem.SubItems(5) = !Address
mItem.SubItems(6) = !ID
If !Qty2 <> "" Then
LV1.ListItems.Add.SubItems(2) = !Qty2 & " > " & !Item2
End If
If !QTY3 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY3 & " > " & !Item3
End If
If !QTY4 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY4 & " > " & !Item4
End If
If !QTY5 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY5 & " > " & !Item5
End If
If !QTY6 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY6 & " > " & !Item6
End If
If !QTY7 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY7 & " > " & !Item7
End If
If !QTY8 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY8 & " > " & !Item8
End If
If !QTY9 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY9 & " > " & !Item9
End If
If !QTY10 <> "" Then
LV1.ListItems.Add.SubItems(2) = !QTY10 & " > " & !Item10
End If
LV1.ListItems.Add.SubItems(2) = ""
rst.MoveNext
Loop
.Close
End With
Set rst = Nothing
If strPickUp = "" Then
Label3.Visible = True
Label4.Visible = False
lblPickUp.Visible = False
Else
Label3.Visible = False
Label4.Visible = True
lblPickUp.Visible = True
Exit Sub
End If
If LV1.ListItems.Count = 0 Then
LV1.Enabled = False
Else
LV1.Enabled = True
End If
End Sub
And this is the code ive been trying to use to change the color:

Code:
If !Catering = "YES" Then
mItem.SubItems(1) = &H8000000F
Else
mItem.SubItems(1) = &HC0C0C0
End If
If anyone can help me out to get this thing working i would greatly appreciate it!

David

Coloring Hyperlinks
hi, ive just discoverd a way to make hyperlinks work in a rich text box but when the user types a weblink in i need my app to highlight the address in blue.

this is the basic code i came up with


Code:
Private Sub r_Change()
On Error Resume Next
Dim s As Integer
s = r.SelStart
If InStr(1, r.Text, "www.") = 0 Then: Exit Sub
Dim temp As Integer
Dim t As Integer
t = 1
Do
If InStr(t, r.Text, "www.") = 0 Then: Exit Do
If t = InStr(t, r.Text, "www.") And t <> 1 Then: Exit Do
t = InStr(t, r.Text, "www.")
If t = 1 Then: Exit Do
DoEvents
Loop
r.SelStart = t - 1
r.SelLength = InStr(t, r.Text, " ") - t
r.SelColor = vbBlue
r.SelStart = s
End Sub

this works fine for the first hyperlink but it doesnt color any after that. is there a better way of doing this??

please help!!

Chat RTB Coloring
Ive read the previous posts about this, and some of the Q's fit my crieteria, but i quite dont understand it. When the users are chatting, it comes out as

<UserName> text they typed in the textbox

(the username is stored in a variable from a previous form and sent out to the server, ANYWAY!)

Im trying to get the <Username> part to be RGB(0, 0, 170) and the text they typed to be normal typing (9pt, Arial).

I can get it to work for the 1st line only at 1 attempt i tried,

Code:
Private Sub RichTextBox1_Change()
If InStr(1, RichTextBox1.Text, "<") <> 0 And InStr(1, RichTextBox1.Text, ">") <> 0 Then
RichTextBox1.SelStart = InStr(1, RichTextBox1.Text, "<") - 1
RichTextBox1.SelLength = InStr(1, RichTextBox1.Text, ">") - RichTextBox1.SelStart
RichTextBox1.SelColor = vbBlue
End If
End Sub

But InStr is a 1 time use function.. anywoo!
e.g.
<UserName> Text
<UserName> Text

Thx -

Textbox Coloring
Is there a way I can make a text box format certain text between tags turn into a simple color, like if it sees
Code:
<b> and </b>
it will make that and all the text inside it red or whatever?
Edit: Sorry, forgot to put code

Coloring Certain Part Of RTB
Hey,

I'm trying to write a program that will aid the user in writing a script file for a certain game.

I can load the script file (which is a .script file but can be opened as a txt file) into a RTB.

Now I want to color certain parts of certain lines...
For example, I want all comments (that start with "//") to become green.

I have no idea how to do this... I've never used a rich text box before.

I got this so far:

Code:
Dim strScriptArray() As String
Dim i As Integer
Dim CommentPlace as Integer

strScriptArray = Split(strScript, vbCrLf)

'Check for comments
For i = 0 To UBound(strScriptArray)
CommentPlace = InStr(1, strScriptArray(i), "//")
If CommentPlace > 0 Then
'color everything in current line from 'Commentplace' to the end green
End if
Next


strScript contains the entire script file.
It gets split into all seperate lines in an array, strScriptArray()

I think my current code will work, except for the actuall coloring part... I have no idea how to tell the richtextbox to color line x, starting with character y for example... Is this even possible?

API Coloring Of Controls
Well.. I just discovered the API section which answered about 6 of my 24785 questions, but here's another.. I have all kinds of fancy graphics and everything on my forms. But then there's a VScrollBar.....

It uses the basic non-winXP theme settings so it looks kinda trashy on my forms.. Now i can make this look just fine if i can color it like people do on most webpages... But i dont know how! I tried to figure out the API for it myself, but only got nowhere

Also i have a ListView in a Report View. Is there a way to color the gridlines and the column headers?

Syntax Coloring In RTB
how can i implement this??

Coloring Syntax
Anyone know a function to start color syntax of a Textbox. What I mean is like if the file ends in .java and like an if statement that would look something like this (my guess.. in php as I have this for my forums)


Code:
1 => array(
'for', 'foreach', 'if', 'else', 'while', 'do',
'switch', 'case'
),

================================================

'KEYWORDS' => array(
1 => 'font-weight: bold;', //#b1b100
2 => 'font-weight: bold;',
3 => '',
4 => 'font-weight: bold;'
),


I need like erm a function to only display the word in a different color not changing the color of the word it self

Coloring Strings
I'm new to VB 6 and I'm not sure how to do this. I need code for a program that automaticly selects parts of a string and changes the colour between a range.

I need the code to find a indicator in the string that represents a starting point for a colour, it must change the colour of the text between the indicator substring to the next occurance of a character. This must all take place inside a Rich Text Box. This may be hard to visualize what I'm getting at. But here's an example of what the program must do.

Indicator substring for green will be ">g"
A ">" indicates when the colour should return to normal.

Example:

Input
>gToday is a nice day>, it's not raining. >gTommorow it> will rain.

Output
>gToday is a nice day>, it's not raining. >gTommorow it> will rain.

OR

Today is a nice day, it's not raining.Tommorow it will rain.

I would greatly appreciate this snippet of code. I can take care of the rest, I just need this code.

Thank You

Coloring MXFlexGrid
how do i change the background color of different rows in a MXFlexGrid ?

Coloring Sstab
Lets Try This One For and Example Of Coloring SStab

Coloring Code
I was after a better / faster way to color vb code in a rich text box.

It's for a code manager app..

Some of the psc stuff worked ok but it wasn't really fast enough..

Coloring A Flexgrid
Is there a way to color a flexgrid without entering each cell? For example, I have been using code similar to the following...

For X = 1 to MSFlexGrid.Rows - 1
For Y = 1 to MSFlexGrid.Cols - 1
MSFlexGrid.Row = X
MSFlexGrid.Col = Y
MSFlexGrid.CellBackColor = vbBlack
Next Y
Next X

It is very anoying to actually have to select each row and coloumn, and then fill in the cell backcolor. Is there a better way to do this? Thanks!

Coloring RTB (without Selecting It)
How can I color text in a RTB box without selecting it. I mean I have heard of this being done by code. Does anyone know how it works, or where I can find out how it works.

Coloring Words
I was using this code in Text_Change, but it starts slowing down sometimes. I was wondering if there was a faster way(the code executes and works fine). I want the words abstract and if to turn blue.

Dim Check As Integer
Check = InStr(Text.Text, "abstract")
If Check > 0 Then
Text.SelStart = Check - 1
Text.SelLength = 8
Text.SelColor = vbBlue
Text.SelStart = Len(Text.Text)
Text.SelColor = vbBlack
End If
Check = InStr(Text.Text, "if")
If Check > 0 Then
Text.SelStart = Check - 1
Text.SelLength = 2
Text.SelColor = vbBlue
Text.SelStart = Len(Text.Text)
Text.SelColor = vbBlack
End If

Coloring The Code :)
hi all

I have a richtextbox and a commandbutton
I want to make vbcode (4 forums) from the normal code in another richtextbox

all the vbkeywords stored in a file called vbkeywords.txt

how do I know if a line is a comment to make it green
and how do I know if a word is a keyword to make it dark-blue
and how do I know if a string between " " to make it (say) red

so if I put this in the first richtextbox


'This project needs a button
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Me.Caption = "Your system will sleep 5 sec."
'Sleep for 5000 milliseconds
Sleep 5000
End Sub

and then if I click on command1 I get the following output in the second richtextbox

[color=****]This project needs a button[/color*]
[color=darkblue*]Private Declare Sub[/color*] Sleep [color=darkblue*] Lib [/color*][color=red*]"kernel32"[/color]
...
...
...
and so on


thanks

Coloring Words
In VB when you type certain words (like 'If') they change color. Ive seen code bits that do this in a RTF box by selecting every letter one-by-one every time you type something. it works but is also EXTREMELY annoying...does anyone know of another way to do it? If there are any custom controls that would that would be ok too.

Coloring Title Bar
Is there a eaiser/better looking way to color the title bar other than the gradients module or a way to use that better? It looks OK with a normal form, not fully normal, but when you do addofficeborder it really looks bad. Or could it be the order i did it?
any help wanted... thanks

Coloring Scrollbars
No the Microsoft Forms 2.0 Library is the answer

RichTextBox Coloring
I'm making a simple 2 person chat prog. I want to have different colors for the user names for "UserA" and "UserB" and for them to be in bold. The colors dont work they way I would like them to. The colors only appear on UserA, (the one who was listening for the connection request), and it doesnt have separate coloring for either user. Just one color or the other. Here is partial source for my program: (Just the coloring Sub's and the locations they are called from)


Code:

Private Sub b_sendout_Click()
Winsock1.SendData t_input.Text
AddUserText "You", t_input.Text
t_input.Text = ""
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData incomingbuffer, vbString
AddRecipText "Recipiant", incomingbuffer
End Sub

Sub AddRecipText(Username As String, Text As Variant)
t_output.SelStart = Len(t_output.Text)
t_output.SelLength = 0
t_output.SelBold = True
t_output.SelColor = RGB(0, 0, 255)
t_output.Text = t_output.Text & Username & " said: "
t_output.SelStart = Len(t_output.Text)
t_output.SelLength = 0
t_output.SelBold = False
t_output.SelColor = RGB(0, 0, 0)
t_output.Text = t_output.Text & Text & vbCrLf


't_output.SelBold = False
't_output.SelColor = RGB(0, 0, 0)
End Sub

Sub AddUserText(Username As String, Text As Variant)
t_output.SelStart = Len(t_output.Text)
t_output.SelLength = 0
t_output.SelBold = True
t_output.SelColor = RGB(255, 0, 0)
t_output.Text = t_output.Text & Username & " said: "
t_output.SelStart = Len(t_output.Text)
t_output.SelLength = 0
t_output.SelBold = False
t_output.SelColor = RGB(0, 0, 0)
t_output.Text = t_output.Text & Text & vbCrLf


't_output.SelBold = False
't_output.SelColor = RGB(0, 0, 0)
End Sub

--Descriptions of controls--

t_output - RichText - Where the "chat log" is displayed.
t_input - TextBox - Where you would type the message that is sent.
t_Ipcon - TextBox - User enters IP or Hostname of who to connect to here
con_Ip - Label - displaying the IP you are connect to. (only works partially)
con_port - Label - displaying the port you are connected to always 2100.
l_stat - Label - displaying the current connection status. (only works partially)
b_discon - CommandButton - Disconnect button
b_sendout - CommandButton - Send button
b_con - CommandButton - Connect button



Thanks in advance.

Code Coloring
Well, someone has to make it. It's the color coding thing, since that option is available anymore in Vb-World, I am making something that allows you to enter code and it automatically converts it to the color coding.

This is probably going to be for everyone to use (hope everyone uses it ).

Problem is, I can't think of every word that needs to be colored.

Can someone list every single word that colorizes and help me out here?

Thanks.

HTML Tag Coloring, Anyone?
Hey guys and gals -

I am working with an RTFText Box, and I need to make tag coloring for HTML elements such as: carrots (<, and >), equal signs with quotation marks (=""), and text that's in between the quotation marks (="text"). If anyone can help me out on this, I'd GREATLY appreciate it. Or, if anyone has a source code of it, I'd like that, too.

If you have these, reply on this forum, or EMAIL me at:
czaries@hotmail.com

Coloring The Cells With The Same Value Using VBA
Hello,

I want to color all the cells in column B that are either 453565, 87678, or 100434 with a different color. I use the following code but it keeps giving the "Subscript out of range error". Could you tell me what can be the problem.

Thanks for your help.




Code:

Sub Color_cells_in_Range()
Dim FirstAddress As String
Dim MySearch As Variant
Dim myColor As Variant
Dim rng As Range
Dim I As Long

MySearch = Array(453565, 87678, 100434)
myColor = Array("3", "6", "9")


With Sheets("Sheet1").Range("B1:B100")

.Interior.ColorIndex = xlColorIndexNone

For I = LBound(MySearch) To UBound(MySearch)
Set rng = .Find(What:=MySearch(I), _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)


If Not rng Is Nothing Then
FirstAddress = rng.Address
Do
rng.Interior.ColorIndex = myColor(I)
Set rng = .FindNext(rng)
Loop While Not rng Is Nothing And rng.Address <> FirstAddress
End If
Next I
End With
End Sub

Coloring Scrollbars?
What API(s) do i use to change the scrollbar colors???

I want to be able to do this to a RichTextBox and a ListView..

and have the following effects: (example code in CSS)
Code:body {
  SCROLLBAR-FACE-COLOR: #DD0000;
  SCROLLBAR-HIGHLIGHT-COLOR: #CC5555;
  SCROLLBAR-3DLIGHT-COLOR: #DD6666;
  SCROLLBAR-DARKSHADOW-COLOR: #330000;
  SCROLLBAR-SHADOW-COLOR: #990000;
  SCROLLBAR-ARROW-COLOR: WHITE;
  SCROLLBAR-TRACK-COLOR: #660000;
}
Colors there are just examples..

Thanx

Coloring Your Alphabet
Hi all, i have a small issue. this is my idea for trying to make numbers to color the alphabet. but for some reason i am doing something wrong.. here is my example to make it work. I am a beginner at this..

What I am looken to do..

dim Var
var = chr(94) ' is ^

1 is red
2 is green
3 is blue
4 is black
5 is yellow

so now:

^1B

B is Red

^2i

i is Green

it will be Bi in the label1.caption in there appropriate colors.

what i want to do is that i type this in a text box and fire command by clicking on the button it will show on the label1.caption window in 2 different colors.

I been scratching my head all day long writing simple code but its not working at all.. lol could somebody help me with this?

Thanks

Syntax Coloring - Please Help!
How would i color C code in my rich text box?

Does anybody know a component or a way to do it in vb?


---------------------
~:{Decayed}:~
the.decayed@usa.net
http://www.q3seek.com

Copyright © 2005-08 www.BigResource.com, All rights reserved