Solved

Treeview node not highlighted in Windows 7 - Vista OK

Posted on 2012-03-22
3
472 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
[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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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 …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

734 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