Go Back   Gaming Gutter > Non-Gaming > Programming > Source Code


Source Code - Have a source code/project files you want to post? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Heather wants to kill a...
Today 06:49 PM
Last post by .BloodyNightmare
Today 07:32 PM
14 Replies, 47 Views
Go to first new post The ctrl v button game!
04-07-2007 02:50 PM
Last post by Arthritis
Today 07:30 PM
765 Replies, 6,540 Views
Go to first new post On a serious note
Today 07:28 PM
by Bex
Last post by Bex
Today 07:29 PM
1 Replies, 2 Views
Go to first new post Froze-owned
11-03-2008 08:32 PM
by Reemer
Last post by checkone
Today 07:27 PM
15 Replies, 314 Views
Go to first new post forgot my birthday i put...
10-30-2008 09:27 AM
by dookie
Last post by checkone
Today 07:25 PM
22 Replies, 463 Views
Reply
 
LinkBack Thread Tools Display Modes

 [VB6]Change Color Function ( ListView )
Old 02-24-2007, 06:28 PM   #1 (permalink)
Banned

Bump J is offline
 
Join Date: Feb 2007
Posts: 100
GPoints: 20
iTrader: 0 / 0%
Bump J Is gaining popularity
Rep Power: 0
[VB6]Change Color Function ( ListView )

This is a function so it makes a pattern of colors in listview

Code:
Public Function ChangeColors(LvwName As ListView, strColEven As String, strColOdd As String)
Dim strNumber1 As String
Dim strNumber2 As String
Dim i As Long

For i = 1 To LvwName.ListItems.Count Step 1
    strNumber1 = i
        strNumber2 = Mid(strNumber1, Len(strNumber1))
            If strNumber2 = "0" Or strNumber2 = "2" Or strNumber2 = "4" Or strNumber2 = "6" Or strNumber2 = "8" Then
                LvwName.ListItems.Item(i).ForeColor = strColEven
            Else
        LvwName.ListItems.Item(i).ForeColor = strColOdd
    End If
Next i
End Function
You could put that function into a module or something then put this somewhere in your code like after you add some items or load a list

Code:
ChangeColors ListView, &HFF&, &HFF0000
then your listview will look like this

Example1 (Color Will Be Blue)
Example2 (Color Will Be Red)
Example3 (Color Will Be Blue)
Example4 (Color Will Be Red)
Example5 (Color Will Be Blue)
Example6 (Color Will Be Red)
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 07:37 PM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.08969307 seconds (100.00% PHP - 0% MySQL) with 19 queries