Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview not rendering

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
I have this problem driving me crazy
I have a treeview that will not render properly, I mean it does not show the border and correct size until I click in the object
I have tried all kinds of things, resize, refresh etc
I set the width to 10, then back to original and it will not render properly

Any ideas?
PS I have another treeview on the same form almost identical, and this renders fine
 
Have you tried using the Thor Compare with Copied Object tool to see what's different about the two?

Tamar
 
Alternatively, try this:

Delete the bad treeview. Make a copy of the good treeview to use in place of the bad one. Gradually change the copy so as to restore the behaviour that you deleted. At each change, test the form. When the bad behaviour comes back, you will know exactly what caused the problem.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Just to recap, there was nothing actually wrong with either of the treeview classes. I did not find the problem, but I put it down to there being a lot of nested containers & the firing order of resizes in the inits of the containers & objects created on the fly.
So in the container parent class, I have a property called "allowresize" and a method "resizecontainer", which prevents the containers from running multiple resizes during the init phase
In the resize event I have:

Code:
If this.allowresize=.t.
   this.resizecontainer && sets size of container
endif
In the very end of the form init I call the resizes in the correct sequence so each one fire only once. Then set the allowresize to .t. for user interaction. I have noticed the form load time is significantly quicker.

I solved the issue of the treeview by adding a timer (20ms) to the form class that re-calls resize on the treeviews at the end of all the init events.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top