-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitGridResult.pas
44 lines (35 loc) · 1.27 KB
/
UnitGridResult.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
unit UnitGridResult;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, StdCtrls, Buttons, ExtCtrls;
type
TFormResultGrid = class(TForm)
PanelBas: TPanel;
BitBtnClose: TBitBtn;
DataSource1: TDataSource;
DBGridResult: TDBGrid;
procedure FormResize(Sender: TObject);
procedure DBGridResultDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormResultGrid: TFormResultGrid;
implementation
{$R *.dfm}
procedure TFormResultGrid.FormResize(Sender: TObject);
begin
BitBtnClose.Left := PanelBas.Width -(BitBtnClose.Width + 10);
end;
procedure TFormResultGrid.DBGridResultDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
// if Odd(TDBGrid(Sender).DataSource.DataSet.RecNo)
// Then TDBGrid(Sender).Canvas.Brush.Color := clSilver
// Else TDBGrid(Sender).Canvas.Brush.Color := clDkGray;
TDBGrid(Sender).Canvas.FillRect(Rect);
TDBGrid(Sender).Canvas.TextOut(Rect.Left+1, Rect.Top+2, StringReplace(Column.Field.Value, #13#10, ' ', [rfReplaceAll]));
end;
end.