窗体ok按钮事件代码如下:
procedure TFrmCPSelect.btnOKClick(Sender: TObject);
var
i:Integer;
begin
try
if self.HasSelected then
begin
FSelectType := '';
FSelectKey := '';
for i:=0 to chklst.Count -1 do
begin
if chklst.Checked then
begin
if FSelectType ='' then
begin
FSelectType := chklst.Items.Strings;
FSelectKey := lstKeys.Strings;
end
else
begin
FSelectType := FSelectType + ','+chklst.Items.Strings;
FSelectKey := FSelectKey +','+lstKeys.Strings;
end;
end;
end;
self.ModalResult := mrOk;
end;
// else
// self.ModalResult := mrCancel;
finally
lstKeys.Free;
self.Close;
end;
end;