Solved

TreeView changing text color problem

Posted on 2006-10-27
2
340 Views
Last Modified: 2008-03-06
I have a treeview and I cant seem to change the forecolor on a nodes text.

The weird thing is that I can change the backcolor and that works fine. Any ideas?

'This Does works
Me.tvStatute.BeginUpdate()
Me.tvStatute.SelectedNode.BackColor = Color.Orange
Me.tvStatute.EndUpdate()

'This Doesn't work at all
Me.tvStatute.BeginUpdate()
Me.tvStatute.SelectedNode.ForeColor = Color.Orange
Me.tvStatute.EndUpdate()

Why would changing the backcolor work, but changing the forecolor not work?
Thanks,
0
Comment
Question by:bertino12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
gangwisch earned 250 total points
ID: 17820498
this worked:
Private Sub TreeView1_BeforeSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeView1.BeforeSelect
        e.Node.ForeColor = Color.AliceBlue
    End Sub
0
 

Author Comment

by:bertino12
ID: 17835450
Yes, thats a bit different than the way I did mine though. That does work, but for me the way I showed above works for backcolor, but not forecolor.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question