delphi 如何让tcxGrid左边显示序号
2017-09-20 16:09
134 查看
第一步:
设置cxgrid的属性, OptionsView.Indicator = True
第二步:
写OnCustomDrawIndicatorCell方法
var
FValue: string;
FBounds: TRect;
begin
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
FValue :=IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index+1);
FBounds := AViewInfo.Bounds;
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
InflateRect(FBounds, -1, -1);
ACanvas.Font.Color := clBlack;
ACanvas.Brush.Style := bsClear;
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
ADone := True;
end;
end;
设置cxgrid的属性, OptionsView.Indicator = True
第二步:
写OnCustomDrawIndicatorCell方法
var
FValue: string;
FBounds: TRect;
begin
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
FValue :=IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index+1);
FBounds := AViewInfo.Bounds;
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
InflateRect(FBounds, -1, -1);
ACanvas.Font.Color := clBlack;
ACanvas.Brush.Style := bsClear;
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
ADone := True;
end;
end;
相关文章推荐
- Delphi 7.0如何连接Mysql数据库,并在delphi窗体上显示
- <c:forEach >中如何显示序号
- Delphi中如何使右侧的滚动条自动拖到底端以显示 RichEdit 最新添加的文本
- oracle中blob格式在delphi中如何显示出来
- delphi 如何知道 Treeview,Listview 当前最上面显示的节点
- GridView控件如何显示序号
- 用Delphi如何读取Wav文件的波形,并且显示?
- 如何让Delphi的程序在SQL Server控制台中的进程信息显示应用程序的名字?
- Delphi中如何给一个字符串从左边进行补0
- 如何让从数据库中查询出符合条件的记录,然后给每个记录自动加上序号,序号是根据符合条件的记录多少在随时变化.而且也会在以查询生成的报表中显示出来.谢谢
- Developer Express控件组合中的GridControl控件,如何自动显示每一行的序号
- Delphi 2007里面如何添加Pas文件的组件,并在工具箱显示
- Developer Express控件组合中的gridcontrol控件,如何自动显示每一列的序号?(转)
- Developer Express控件组合中的GridControl控件,如何自动显示每一行的序号
- Adobe Edge Animate --如何将舞台居中显示而非停靠左边?
- Developer Express控件组合中的GridControl控件,如何自动显示每一行的序号
- 如何使datalist的第一列显示记录序号?
- 在一张静态图中如何显示点的动态信息(C#+Delphi)
- Developer Express控件组合中的GridControl控件,如何自动显示每一行的序号
- 如何设置eclipse左边显示包结构及包的显示方式