注册 登录
编程论坛 Delphi论坛

求高手指点——delphi学习方法

Liu_007 发布于 2013-10-12 23:35, 2291 次点击
我是一个delphi的初学者,我想把delphi学好,但是不知道从何学起,恳请高手指点!
1 回复
#2
haiou3272013-10-13 13:44
这里有你想要的
https://bbs.bccn.net/thread-421721-1-1.html
程序代码:
unit Unit1;
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
  TcustCls = class
  private
    Fx, Fy: Integer;
    Fs: string;
  public
    procedure outPut(x, y:Cardinal; s: string);
  end;
var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure Tcustcls.outPut(x, y: Cardinal; s: string);
begin
  if (x > 0) and (y > 0) then
  begin
    fx := x;
    fy := y;
    fs := s;
    Form1.Canvas.TextOut(fx, fy, fs);
  end
  else
    ShowMessage('坐标错误');
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  myText: TcustCls;
begin
  myText := TcustCls.Create;
  myText.outPut(60, 50, '代码测试.....');
  myText.Free;
end;
end.
1