刚编好的………
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst;
type
TForm1 = class(TForm)
CheckListBox1: TCheckListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure CheckListBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(inttostr(i));
end;
procedure TForm1.CheckListBox1Click(Sender: TObject);
begin
if CheckListBox1.Checked[CheckListBox1.ItemIndex] then
inc(i)
else
dec(i);
end;
end.