Seems like it shouldn't even be an issue but I've found that sometimes issuing a single TreeView_DeleteAllItems(hwnd) doesn't update the treeview display that it has actually deleted all the items. I noticed this with less than 50 entries and two levels.
The TreeView_DeleteAllItems is immediately followed by filling the treeview with a different set of items. It's used as a sub menu listing of programs.
Navigating the left treeview updates upon SelectItem the contents of the right treeview. On treeviews that have more members than will fit if everything is expanded it seems to clear anything visible and most of the time the rest are visible. Once the new items for the treeview start inserting it finally goes away but in the meantime it seems like pretty annoying unnecessary scrolling and redrawing.
I've tried creating another identically sized treeview and doing shows and hides while doing two TreeView_DeleteAllItems. This trades one kind of flicker for another.
The best solution so far is two TreeView_DeleteAllItems size it to 0,0 and resize when its done redrawing the new treeview items. (still noticeable)
Anyone else know a faster way to do this or one that doesn't flicker.
Here is the definition of the treeview control. Maybe there is an equate that needs tweaking.
A faster way to load the treeviewitems might help but there aren't more than 50 items to load.
The right treeview might load and unload up to 20 times if the user uses the up and down arrow on the left treeview.
BOB MECHLER
The TreeView_DeleteAllItems is immediately followed by filling the treeview with a different set of items. It's used as a sub menu listing of programs.
Navigating the left treeview updates upon SelectItem the contents of the right treeview. On treeviews that have more members than will fit if everything is expanded it seems to clear anything visible and most of the time the rest are visible. Once the new items for the treeview start inserting it finally goes away but in the meantime it seems like pretty annoying unnecessary scrolling and redrawing.
I've tried creating another identically sized treeview and doing shows and hides while doing two TreeView_DeleteAllItems. This trades one kind of flicker for another.
The best solution so far is two TreeView_DeleteAllItems size it to 0,0 and resize when its done redrawing the new treeview items. (still noticeable)
Anyone else know a faster way to do this or one that doesn't flicker.
Here is the definition of the treeview control. Maybe there is an equate that needs tweaking.
A faster way to load the treeviewitems might help but there aren't more than 50 items to load.
The right treeview might load and unload up to 20 times if the user uses the up and down arrow on the left treeview.
Code:
CONTROL ADD "SysTreeView32", hdlg,%ID_TREE2, "", 196, 5, 165, 198, _ %WS_CHILD OR %WS_TABSTOP OR %WS_VISIBLE OR %TVS_HASBUTTONS OR _ %TVS_HASLINES OR %WS_CLIPCHILDREN OR _ %TVS_LINESATROOT OR %TVS_SHOWSELALWAYS OR %TVS_TRACKSELECT OR _ %TVS_DISABLEDRAGDROP,%WS_EX_STATICEDGE
Comment