Board index » cppbuilder » why ttreeview autodelete item????

why ttreeview autodelete item????


2008-07-25 01:07:29 AM
cppbuilder20
I find that, if TTreeview in a TFrame not a TForm
TTreeview will auto delete the treenode after add it,
help!!!
how can I solve it?
 
 

Re:why ttreeview autodelete item????

"Emmanuel" < XXXX@XXXXX.COM >wrote in message
Quote
I find that, if TTreeview in a TFrame not a TForm
TTreeview will auto delete the treenode after add it,
help!!!
How are you determining that? Please provide more details.
Gambit
 

Re:why ttreeview autodelete item????

very easy,
TTreeView*tv;
....
tv->OnDeletion=OnTVDeletion
tv->OnAddition=OnTVAddition
after you add the data,
it will automaticly
(step1)go to OnTVDeletion delete from the first data to the last data,
(step2)and then go to OnAddition, add from the first data to the last data
step 1 is must,
step 2 is not must , step 2 need to see what situation, if the parent of tv
is normal VCL ,it will go step 1+ step 2; if the parent of tv is
TCustomControl ,it will only go step 1
these case is just using in TFrame, if using in TForm, no problem
what happen ? how can I handle?
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >дʼ
Quote

"Emmanuel" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>I find that, if TTreeview in a TFrame not a TForm
>TTreeview will auto delete the treenode after add it,
>help!!!

How are you determining that? Please provide more details.


Gambit


 

{smallsort}

Re:why ttreeview autodelete item????

"Emmanuel" < XXXX@XXXXX.COM >wrote in message
Quote
(step1)go to OnTVDeletion delete from the first data to the last data,
(step2)and then go to OnAddition, add from the first data to the last data
The only time TTreeView wipes out all of its nodes and recreates them like
that is when its HWND is being changed. Since you have put the TTreeView
onto a TFrame, that sequence of events is going to happen anytime the TFrame
is moved to a new Parent, as that requires the TFrame's HWND to be
recreated, and thus the TTreeView's HWND as well.
Quote
what happen ? how can I handle?
Why not just let the events happen normally? They are doing what they are
supposed to be doing. What problem are you trying to solve exactly?
Gambit