Solved

Treeview node not highlighted in Windows 7 - Vista OK

Posted on 2012-03-22
3
469 Views
Last Modified: 2012-03-22
I have a treeview consisting of a list of products  on the left hand side of screen. When an item in the treeview is selected a subform of the main form to the right of the treeview  displays the details of the item.

When the database runs under Vista if control is lost to the subform, the item on the treeview is still highlighted - less brightly but greyed over. So its still clear to the user where he/she is in the treeview. I dodn't do anything to achieve this - it just happens by default.
 
If my database runs on Windows 7 this semi-highlight is lost completely.

I have searched around the forum and the web but I can't find any way to keep the selected node highlighted when the treeview has lost focus.

In Windows 7 I also lose the horrible grey background to tab control - which I don't mind! - I think the difference to the treeview  might be something to do with this; Any ideas?

Thanks

Lou
0
Comment
Question by:Louverril
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 37752253
Whenever I use a treeview, I always include the following as the first several lines of the treeview controls NodeClick event.

'make sure the current node is highlighted and selected
Dim tvw As MSComctlLib.TreeView
Set tvw = Me.treeControlName.Object
tvw.DropHighlight = Nothing
tvw.DropHighlight = node
node.Selected = True

   
**Note:
1.  you need to replace "treeControlName" with the name of your treeview control
2.  That last line (Node.Selected = true) is there because there are occasions where I call the NodeClick event to set the focus to the node without actually clicking on it.  You probably don't need that line, but I would definitely include the two DropHighlight lines.
0
 

Author Comment

by:Louverril
ID: 37752808
I must admit I was doubtful that this would work - but it does!

Brilliant.

Thank you very much.

Lou
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37752888
Lou,

In case you have not already found this site, here is a really good source for treeview stuff.

http://mytreeviewblog.blogspot.com/

I recommend you start with his oldest post and work towards Episode #7.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now