delphi中调用公有函数声明的问题

来源:百度知道 编辑:UC知道 时间:2024/06/15 13:15:49
unit Unit1;
interface
uses
type
TForm1 = class(TForm)
Button14: TButton;
listview1: TListView;
Action1: TAction;
procedure Button14Click(Sender: TObject);
procedure Action1Execute(i,a: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

procedure TForm1.Action1Execute(i,a: Integer);
begin
if listview1.Items.Count >0 then
for i :=0 to listview1.Items.Count -1 do
begin
a:= listview1.Items.Count;
listview1.Items.Item[i].Caption:= IntToStr(a);
end;
end;

procedure Button14Click(Sender: TObject);
begin
请教高人在这里该怎么写才能调用Action1Execute的运行
end;

谢谢!

procedure TForm1.Action1Execute(i,a: Integer);
begin
if listview1.Items.Count >0 then
for i :=0 to listview1.Items.Count -1 do
begin
a:= listview1.Items.Count;
listview1.Items.Item[i].Caption:= IntToStr(a);
end;
end; //严重错

我 不信你 能 执行通过
、、‘’‘’‘’‘’‘

unit Unit1;

interface

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

type
TForm1 = class(TForm)
ActionList1: TActionList;
Action1: TAction;
Button1: TButton;
procedure Action1Execute(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Action1Execute(Sender: TObject);
begin
//执行代码
end;<