/*
Items, Delete example
The following cross-platform example deletes an item in the tree view when the user clicks on it if a checkbox is checked. 
*/ 
void __fastcall TForm1::TreeView1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
  THitTests HT;
  if (CheckBox1->Checked && Sender->ClassNameIs("TTreeView"))
  {
    TTreeView *pTV = (TTreeView *)Sender;
    HT = pTV->GetHitTestInfoAt(X,Y);
    if (HT.Contains(htOnItem))
      pTV->Items->Delete(pTV->GetNodeAt(X,Y));
  }
} 
