📄 unit4.~pas
字号:
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, EasyGrid;
type
TForm1 = class(TForm)
Grid1: TEasyGrid;
procedure Grid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TEasyGridDrawState);
procedure Grid1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
bVisible:boolean;
implementation
{$R *.dfm}
procedure TForm1.Grid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TEasyGridDrawState);
var
i:integer;
begin
with grid1 do
begin
with canvas do
begin
brush.Color:=rgb(0,255,0);
font.Color:=rgb(0,0,0);
font.Size:=11;
textRect(grid1.CellRect(1,3),10,50,'ewr');
for i:=1 to 2 do
begin
ellipse(grid1.CellRect(1,i));
//brush.Color:=rgb(0,152,0);
//ellipse(grid1.CellRect(2,1));
end;
end;
end;
end;
procedure TForm1.Grid1Click(Sender: TObject);
begin
if not bVisible then
begin
with grid1,canvas do
begin
brush.Color:=rgb(0,255,0);
font.Color:=rgb(0,0,0);
font.Size:=11;
//textRect(grid1.CellRect(1,3),10,50,'ewr');
//ellipse(grid1.CellRect(1,2));
//brush.Color:=rgb(0,152,0);
ellipse(grid1.CellRect(grid1.Col,grid1.row));
//copyrect(
end; bvisible:=not bvisible;
end
else
begin
with grid1,canvas do
begin
brush.Color:=rgb(255,255,255);
font.Color:=rgb(0,0,0);
font.Size:=11;
pen.color:=rgb(255,255,255);
//textRect(grid1.CellRect(1,3),10,50,'ewr');
//ellipse(grid1.CellRect(1,2));
//brush.Color:=rgb(0,152,0);
ellipse(grid1.CellRect(grid1.Col,grid1.row));
bvisible:=not bvisible;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
bVisible:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -