首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

valuelisteditor如何实现左边一列改变背景色,右边一列字体颜色设置

2012-02-07 
valuelisteditor怎么实现左边一列改变背景色,右边一列字体颜色设置?valuelisteditor怎么实现左边一列改变

valuelisteditor怎么实现左边一列改变背景色,右边一列字体颜色设置?
valuelisteditor怎么实现左边一列改变背景色,右边一列字体颜色设置?

[解决办法]
//参考如下代码:
type
TValueListEditorAccess = class(TValueListEditor);

procedure TForm1.ValueListEditor1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
TValueListEditorAccess(Sender).OnDrawCell := nil;
if (ACol = 0) and (ARow > 0) then
TValueListEditorAccess(Sender).Canvas.Brush.Color := $00C0DCC0;
if (ACol = 1) and (ARow > 0) then
TValueListEditorAccess(Sender).Canvas.Font.Color := clRed;
TValueListEditorAccess(Sender).DrawCell(ACol, ARow, Rect, State);
TValueListEditorAccess(Sender).OnDrawCell := ValueListEditor1DrawCell;
end;

热点排行