这个勾勾不是程序能够控制的,看看源码就知道。
procedure TListItem.SetChecked(Value: Boolean);
var
LV: TCustomListView;
begin
FChecked := Value;
LV := Owner.Owner;
if not LV.OwnerData and LV.HandleAllocated then
<font color = #ff0000><strong>ListView_SetCheckState(LV.Handle, Index, Value)</font></strong>;
end;
如果是 TCheckListBox ,还可以控制:
DrawItem 是 virtual 函数,
procedure DrawItem(Index: Integer; Rect: TRect;State: TOwnerDrawState); override;
begin
...
DrawCheck(...);
...
end;
procedure TCheckListBox.DrawCheck(R: TRect; AState: TCheckBoxState; AEnabled: Boolean);
begin
...
DrawFrameControl(Handle, DrawRect, DFC_BUTTON, DrawState);// 勾勾就是在这里画的
...
end;