ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Font colour of specific xl treeview nodes - solved (https://www.excelbanter.com/excel-programming/424722-font-colour-specific-xl-treeview-nodes-solved.html)

michael.beckinsale

Font colour of specific xl treeview nodes - solved
 
Hi all,

Further to my earlier posting and in case anybody else wants to do
this in future the following code snippets will colour the font of the
nodes.

Whilst building the treeview:

Dim nodx As Object
Set nodx = TreeView1.Nodes.Add [relative] [relationship] [key] [text]
nodx.Forecolor = vbRed

When node is selected:

TreeView1.SelectedItem.ForeColor = vbRed

Hope this helps somebody, it has caused me lots of frustration, and
now it seems so simple!

Regards

Michael


All times are GMT +1. The time now is 04:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com