PDA

View Full Version : Solved: Multipage/Treeview Expansion problem



natefarm
04-20-2010, 02:04 PM
Greetings & thanks in advance for any assistance provided.

I'm developing a userform with a multipage object on it with four tabs. Three of them have treeview (tvw) objects. I noticed a delay in switching from one tvw tab to the other, but didn't think much of it until I switched to the 4th tab, and then back to one of the others. In that case, all of the nodes in the tvw showed up as expanded, though they hadn't been before.

To find what was triggering that, I put debug stops on the tvw Expand and Collapse events. I found that when I switch from one tvw to another, for each node that was collapsed it fires the Expand event and then the Collapse event. For each node that was expanded, it fires the Expand event twice. This explains the delay I had noticed, and happens when I go from one tvw tab to another. When I go from the non-tvw tab to a tvw tab, it does the same thing, except instead of expanding and then collapsing the collapsed nodes, it expands them twice also, so they end up expanded.

I can't find anything in my code that would trigger these events, and can't account for the difference in which tab I'm coming from. I looked at the call stack during the events, and they show [<Non-Basic Code>] below the event. I suppose I could live with the delay, but I don't want the nodes expanding themselves.

All of this happens before the Multipage Change event fires.

Any ideas? Thanks again!

natefarm
04-22-2010, 01:20 PM
Me again. FYI, I'm still open to anyone's ideas, but having heard none here, I posted to another forum. www .excelforum.com/excel-programming/726455-multipage-treeview-expansion-problem.html

GTO
04-22-2010, 02:04 PM
Greetings Nate,

Firstly and most importantly, welcome to vbaexpress. There are great folks here and I am sure that you can get a great solution here.

I am headed to bed, so please forgive my blunt/truncated request(s)/response.

I have only played w/treeview and have not really used it.

Thus - I may be of minimal direct help, though I find the question and control of interest.

Could/would you attach an example file that replicates the glitch?

Mark

Aussiebear
04-22-2010, 02:22 PM
Thank you for the link