Hola adsbernardo.
Cita:
la cuestion es cuando se repite el nombre dice que ya esta creado uno, como capturo que ese checklistbox se cerro
|
Si no te entendí mál, creo que podrías hacerte una función que verifique si el CheckListBox existe:
Código Delphi
[-]
...
function TForm1.ExisteCtrl(Nombre: string):Boolean;
var
i: Integer;
begin
Result:= False;
for i:= 0 to ComponentCount -1 do
if Components[i].Name = Nombre then
Result:= True;
end;
Para usarla por ejemplo:
Código Delphi
[-]
procedure TfrmVentas.Button1Click(Sender: TObject);
begin
if not ExisteCtrl(ComboBox1.Text) then with TCheckListBox.Create(Self) do begin
Parent:= Self;
Name:= ComboBox1.Text;
DragKind:= dkDock;
DragMode:= dmAutomatic;
...
end
else
ShowMessage('Ya existe'); end;
Un saludo.