在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
TreeView修改选中的节点的颜色和背景
TCustomDrawTarget = (dtControl, dtItem, dtSubItem);
TCustomDrawStage = (cdPrePaint, cdPostPaint, cdPreErase,
cdPostErase);
TCustomDrawState = set of (cdsSelected, cdsGrayed, cdsDisabled,
cdsChecked,
cdsFocused, cdsDefault, cdsHot, cdsMarked,
cdsIndeterminate);
procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean); begin if (cdsSelected in State) then begin with Sender.Canvas do begin Brush.Color :=clBlue; Font.Color :=clRed; Font.Size := 11; Font.Style:=[fsBold]; end; end; end; 如何画图片 节点的整行的 procedure TForm1.TreeView1AdvancedCustomDraw(Sender:
TCustomTreeView;
const ARect: TRect; Stage: TCustomDrawStage; var
DefaultDraw: Boolean);
procedure TForm1.TreeView1AdvancedCustomDrawItem(Sender:
TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; Stage:
TCustomDrawStage;
var PaintImages, DefaultDraw:
Boolean);
procedure TForm1.TreeView1CustomDraw(Sender:
TCustomTreeView;
const ARect: TRect; var DefaultDraw:
Boolean);
procedure TForm1.TreeView2CustomDrawItem(Sender:
TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw:
Boolean); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论