|
-
Jul 18th, 2000, 07:05 PM
#1
Thread Starter
Junior Member
Hello!
I've been wondering that is it possible to set a text color of a node in treeview list? I have a treeview in my project and I need to color some nodes with black and some with blue?
Does anyone have a some kind of a code snippet about this?
Thanks,
- Ville
[email protected]
......................
Ville Mattila
-
Jul 18th, 2000, 07:22 PM
#2
Lively Member
Hi Skyline:
Yes it's posible to set a text color of a node.
You can use some code like this:
'Treeview1.Nodes([index node]).ForeColor = vbBlue'
You can get the index number of a node in the 'NodeClick' event in the 'TreeView' object with:
'MyNode = Node.Index', then use this 'MyNode' value in the [index node] and ready. Then you can create a procedure with a 'For Next' to select the nodes that you need to change the color or font.
I hope this can help you.
Regards.
Angel Maldonado López.
VB Programmer
-
Jul 18th, 2000, 11:15 PM
#3
Thread Starter
Junior Member
Hello there!
I'm sorry but it didn't help me. I tried the code:
TreeView1.Nodes(0).ForeColor = vbBlue
But I'll get an error "Method or data member not found" and text ".ForeColor = " was selected.
I have VB5.0 Enterprise Edition.
- Ville
......................
Ville Mattila
-
Jul 19th, 2000, 11:10 AM
#4
Lively Member
Sorry Skyline...
I thought that you were using Vb 6.0, for vb5 componentes you need to use API calls, maybe Aaron Young can help you he's an expert en API's.
Sorry Again
Regards.
Angel Maldonado López.
VB Programmer
-
Jul 19th, 2000, 01:33 PM
#5
Frenzied Member
VBAccelerator.com
Hi there, take a look at http://www.VBAccelerator.com
it has *many* cool controls/code/tips so take a look at the TreeView Component and don't forget to download the SSubtmr.DLL and any other neccesary components, but all of these are very small and at least smaller then the Common Controls.
If you don't want to use this you can use the Common Controls 6. If you don't have it you can mail me, I got them from kedaman
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|