whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

16 Visitors Online


 
...show bold nodes in TTreeview component?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (5):  
     




uses
  
CommCtrl;

procedure SetNodeBoldState(Node: TTreeNode; Value: Boolean);
var
  
TVItem: TTVItem;
begin
  if not 
Assigned(Node) then Exit;
  with TVItem do
  begin
    
mask := TVIF_STATE or TVIF_HANDLE;
    hItem := Node.ItemId;
    stateMask := TVIS_BOLD;
    if Value then state := TVIS_BOLD 
    else 
      
state := 0;
    TreeView_SetItem(Node.Handle, TVItem);
  end;
end;

// Example: Make the first node bold.
// Beispiel: Erster Eintrag fett machen.

procedure TForm1.Button1Click(Sender: TObject);
begin
  
SetNodeBoldState(TreeView1.Items[0], True);
end;


 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners