zoukankan      html  css  js  c++  java
  • 取消阴影行

    方法1:独立事件直接写法

    procedure TForm3.N11Click(Sender: TObject);
    var
      I: Integer;
    begin
      for I := 0 to dbgrdh1.SelectedRows.Count-1 do
      begin
        frmDataPool.qry需要做的事.GotoBookmark(pointer(dbgrdh1.SelectedRows.Items[I]));
        frmDataPool.qry需要做的事.Edit;
        frmDataPool.qry需要做的事.FieldByName('选中').AsBoolean := False;
        frmDataPool.qry需要做的事.Post;
      end;
    end;

    方法2:类方法

    unit UUnSelectShadow;
    
    interface
    uses
      Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
      Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Data.DB, Data.Win.ADODB,
      Vcl.ExtCtrls, Vcl.DBCtrls, Vcl.Grids, Vcl.DBGrids, Clipbrd, Vcl.Menus,
      Vcl.StdCtrls, DBGridEhGrouping, ToolCtrlsEh, DBGridEhToolCtrls, DynVarsEh,
      EhLibVCL, GridsEh, DBAxisGridsEh, DBGridEh,EhLibADO,DBGridEhImpExp;
    
    type TUnSelectShadow =class
      public
      class procedure unselectedshadowrecord(var SAdq:TADOQuery;SDBgrdh:TDBGridEh);
    end;
    
    
    implementation
    class procedure TUnSelectShadow.unselectedshadowrecord(var SAdq: TADOQuery; SDBgrdh: TDBGridEh);
      var
      I: Integer;
    begin
      for I := 0 to SDBgrdh.SelectedRows.Count-1 do
      begin
        with SAdq do
        begin
        GotoBookmark(pointer(SDBgrdh.SelectedRows.Items[I]));
        Edit;
        FieldByName('选中').AsBoolean := False;
        Post;
        end;
      end;
    end;
    
    end.

    类方法引用:记住uses中添加引用类单元名 UUnSelectShadow;

    procedure TForm3.N11Click(Sender: TObject);
    begin
    TUnSelectShadow.unselectedshadowrecord(frmDataPool.qry需要做的事,dbgrdh1);  //取消阴影行
    end;
  • 相关阅读:
    oracle-DML-2
    Oracle--DML
    jquery 调用asp.net后台代码
    hdu--1505--稍微特别的子矩阵求和<修改第一次发表的错误>--<增加stack写法>
    hdu--2159--二维费用背包<一维错误解法>
    hdu--2571--dp
    hdu--1231&&1003--dp
    hdu--1251--字典树
    hdu--1075--字典树||map
    hdu--1421--dp&&滚动数组
  • 原文地址:https://www.cnblogs.com/ddxxxb/p/7061517.html
Copyright © 2011-2022 走看看