TcustCls = class
private
Fx, Fy: Integer;
Fs: string;
public
procedure outPut(x, y: Integer; s: string);
end;
procedure Tcustcls.outPut(x, y: Integer; 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;
//调用
var
myText: TcustCls;
begin
myText := TcustCls.Create;
myText.outPut(60, 50, '代码测试.....');
myText.Free;
end;
Class Demo
最新推荐文章于 2022-03-20 19:43:36 发布