testgrf.pas
来自「Delphi高级开发指南是开发程序的好帮手」· PAS 代码 · 共 67 行
PAS
67 行
unit TestGrF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, DdhGraph;
type
TForm1 = class(TForm)
ColorDialog1: TColorDialog;
FontDialog1: TFontDialog;
Image1: TImage;
Panel1: TPanel;
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
Button3: TButton;
DdhGraph1: TDdhGraph;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
ColorDialog1.Color := DdhGraph1.Color;
if ColorDialog1.Execute then
DdhGraph1.Color := ColorDialog1.Color;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
FontDialog1.Font := DdhGraph1.Font;
if FontDialog1.Execute then
DdhGraph1.Font := FontDialog1.Font;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
DdhGraph1.BorderStyle := bsSingle
else
DdhGraph1.BorderStyle := bsNone;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ColorDialog1.Color := DdhGraph1.LinesColor;
if ColorDialog1.Execute then
DdhGraph1.LinesColor := ColorDialog1.Color;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?