• 如何让tcxGrid左边显示序号


    第一步:
    
    设置cxgrid的属性, OptionsView.Indicator = True
    
    第二步:
    
    写OnCustomDrawIndicatorCell方法
    
    procedure TForm1.cxGrid1DBTableView1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
    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;
  • 相关阅读:
    杂项_做个游戏(08067CTF)
    杂项_白哥的鸽子
    杂项_隐写3
    杂项_come_game
    杂项_多种方法解决
    杂项_闪的好快
    杂项_隐写2
    杂项_宽带信息泄露
    杂项_啊哒
    杂项_猜
  • 原文地址:https://www.cnblogs.com/windson/p/12505061.html
Copyright © 2020-2023  润新知