📄 delegate.dpr
字号:
program Delegate;
{$APPTYPE CONSOLE}
uses
Borland.Delphi.SysUtils,
System.Threading;
type
TMyClass = class
public
procedure myMethod;
end;
var
threadDelegate: System.Threading.ThreadStart;
aThread: System.Threading.Thread;
tmc: TMyClass;
{ TMyClass }
procedure TMyClass.myMethod;
begin
// some code goes here
WriteLn ('Executing event handler');
end;
begin
tmc := TMyClass.Create;
threadDelegate := @tmc.myMethod;
aThread := Thread.Create (threadDelegate);
aThread.Start;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -