• AdvStringGrid 删除数据


    unit Unit6;
    
    interface
    
    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvUtil, Vcl.StdCtrls, Vcl.Grids,
      AdvObj, BaseGrid, AdvGrid;
    
    type
      TForm6 = class(TForm)
        AdvStringGrid1: TAdvStringGrid;
        btn1: TButton;
        btn2: TButton;
        btn4: TButton;
        btn5: TButton;
        btn6: TButton;
        procedure btn1Click(Sender: TObject);
        procedure btn2Click(Sender: TObject);
        procedure btn4Click(Sender: TObject);
        procedure AdvStringGrid1GetAlignment(Sender: TObject; ARow, ACol: Integer;
          var HAlign: TAlignment; var VAlign: TVAlignment);
        procedure btn5Click(Sender: TObject);
        procedure btn6Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form6: TForm6;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm6.AdvStringGrid1GetAlignment(Sender: TObject; ARow,
      ACol: Integer; var HAlign: TAlignment; var VAlign: TVAlignment);
    begin
      HAlign := taCenter;
      VAlign := vtaCenter;
    
    end;
    
    procedure TForm6.btn1Click(Sender: TObject);
    var
      i,j: Integer;
    begin
      AdvStringGrid1.WordWrap := False;
      AdvStringGrid1.Multilinecells := True;
      AdvStringGrid1.Cells[0, 1] := '小李飞刀';
      AdvStringGrid1.Cells[1, 1] := '1111111';
      AdvStringGrid1.Cells[2, 1] := '2222222';
    
      AdvStringGrid1.Cells[0, 2] := '小李飞刀';
      AdvStringGrid1.Cells[1, 2] := '1111111';
      AdvStringGrid1.Cells[2, 2] := '2222222';
    
      AdvStringGrid1.Cells[0, 3] := '火云邪神';
      AdvStringGrid1.Cells[1, 3] := '33333333';
      AdvStringGrid1.Cells[2, 3] := '44444444';
    
      AdvStringGrid1.Cells[0, 4] := '火云邪神';
      AdvStringGrid1.Cells[1, 4] := '33333333';
      AdvStringGrid1.Cells[2, 4] := '44444444';
    
      AdvStringGrid1.Cells[0, 5] := '奥巴马';
      AdvStringGrid1.Cells[1, 5] := '33333333';
      AdvStringGrid1.Cells[2, 5] := '44444444';
    end;
    
    procedure TForm6.btn2Click(Sender: TObject);
    begin
      //清空N行数据(保留表格)
      AdvStringGrid1.ClearRows(1, AdvStringGrid1.RowCount - 1);
    end;
    
    procedure TForm6.btn4Click(Sender: TObject);
    begin
      //删除N行数据表格一并删除
      AdvStringGrid1.RemoveRows(AdvStringGrid1.Row, 1);
    end;
    
    procedure TForm6.btn5Click(Sender: TObject);
    begin
      //全部清空数据clear(包括标题)
      AdvStringGrid1.Clear;
    end;
    
    procedure TForm6.btn6Click(Sender: TObject);
    begin
      //全部清空clearAll(包括标题-更深层次慎用-看源码)
      AdvStringGrid1.ClearAll;
    end;
    
    end.
  • 相关阅读:
    Day12——提权学习之第三方软件Radmin提权
    Day11——提权学习之第三方软件VNC提权
    Day10——提权学习之第三方软件FlashFXP及pcAnywhere提权
    Day9——提权学习之第三方软件FileZilla提权
    Day8——提权学习之第三方软件G6-FTP提权
    Day7——提权学习之第三方软件serv-u提权
    Day6——提权学习之Oracle数据库提权学习总结
    Memcached 未授权访问漏洞 CVE-2013-7239
    恭喜tes获得夏季赛冠军
    有关xss的小日记
  • 原文地址:https://www.cnblogs.com/del88/p/6918974.html
Copyright © 2020-2023  润新知