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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronize CheckListBox with TreeView

Status
Not open for further replies.

svanels

MIS
Aug 18, 1999
1,393
SR
I have a CheckListBox, and when a item is checked, a node is added to a Teeview. When I uncheck the item the corresponding node must be destroyed (any suggestions?)

procedure TForm1.clbOrderClickCheck(Sender: TObject);
var node: TTreeNode;
i: integer;

begin
i:= clbOrder.ItemIndex;
if clbOrder.Checked then
begin
//add a node works fine
Node := TreeView.Items.AddFirst(Nil,clbOrder.Items);
end
else
begin
//destroy node
end;
end; S. van Els
SAvanEls@cq-link.sr
 
Surely that doesn't work, as whenever you add an item it won't correspond to the position of the item in the CheckListBox but will just add new items to the start of the TreeView.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top