TreeView nodes in Bold  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 08/05/00

Tip accessed 526 times

 


Without create or derivate a new descendant of TreeView, simple calling the API:

  • Add CommCtrl in the uses of your form


     procedure TForm1.Button2Click(Sender: TObject);
    
       procedure NodoEnBold(node: TTreeNode; OnOff: Boolean);
       var
         tvi: TTVItem;
       begin
         FillChar(tvi, SizeOf(tvi), 0);
         tvi.hItem := node.ItemID;
         tvi.Mask := TVIF_STATE;
         tvi.StateMask := TVIS_BOLD;
         if OnOff then tvi.State := TVIS_BOLD
                  else tvi.State := 0;
         TreeView_SetItem(node.Handle, tvi);
       end;
    
    
     begin
       {Poner en Negrita el Nodo seleccionado...}
       {Put Bold the selected node of Tv1...}
       NodoEnBold(Tv1.Selected,TRUE);
     end;
    



    The prior example, puts the selected node of the TreeView (TV1) in Bold