Advertisement
TLama

Untitled

Jan 8th, 2014
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.83 KB | None | 0 0
  1. uses
  2.   CommCtrl;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6.   ItemEx: TTVItemEx;
  7.   InsertStruct: TTVInsertStruct;
  8. begin
  9.   ItemEx.mask := TVIF_TEXT or TVIF_INTEGRAL;
  10.   ItemEx.pszText := PChar('This node is 3 times higher than default node height');
  11.   // this is the multiplier of default node height, which you can set by sending
  12.   // TVM_SETITEMHEIGHT message even to 1 pixel, but then the lines become broken
  13.   // so if it's sufficient for you to use multiples of default node height, this
  14.   // could be the way but it's "quite difficult" to modify the original VCL tree
  15.   // view control to use the TTVItemEx structure for nodes
  16.   ItemEx.iIntegral := 3;
  17.  
  18.   InsertStruct.hParent := nil;
  19.   InsertStruct.hInsertAfter := TVI_LAST;
  20.   InsertStruct.itemex := ItemEx;
  21.  
  22.   TreeView_InsertItem(TreeView1.Handle, InsertStruct);
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement