Fórum CheckListBox... #219786
10/03/2004
0
True campos Boolean, depois que vários Items do CheckList
for marcado?
Mui Obrigada,
Valchiria
Curtir tópico
+ 0Posts
11/03/2004
Fabio.hc
Ex:
procedure TForm1.Button1Click(Sender: TObject); var i:integer; begin for i:=0 to CheckListBox1.Items.Count - 1 do begin ... query1campo.value:=CheckListBox1.Checked[i]; ... end; end;
Gostei + 0
11/03/2004
Valchiria
procedure TForm1.Button1Click(Sender: TObject); var i:integer; begin for i:=0 to CheckListBox1.Items.Count - 1 do begin ... query1campo.value:=CheckListBox1.Checked[i]; ... end; end;
É quase isto que preciso... só que são vários campos nas tabelas que vão receber valores diferentes de acordo com o CkeckListBox, se estiver checked ou não.
Algo como assim, só que não consegui ainda...
procedure Tcad_empresa_cliente.CheckListBox1Exit(Sender: TObject);
var i : Integer;
begin
module.tb_emprecli.edit;
for i:=0 to CheckListBox1.Items.Count - 1 do
begin
module.tb_emprecliPadarias.Value := CheckListBox1.Checked[i];
module.tb_emprecliSupermercados.Value := CheckListBox1.Checked[i];
module.tb_emprecliPostoGasolina.Value := CheckListBox1.Checked[i];
module.tb_emprecliPapelarias.Value := CheckListBox1.Checked[i];
module.tb_emprecliFarmacias.Value := CheckListBox1.Checked[i];
module.tb_emprecliDentista.Value := CheckListBox1.Checked[i];
module.tb_emprecliLaboratorio.Value := CheckListBox1.Checked[i];
module.tb_emprecliClinicas.Value := CheckListBox1.Checked[i];
module.tb_emprecliOpticas.Value := CheckListBox1.Checked[i];
end;
end;
Gostei + 0
12/03/2004
Fabio.hc
procedure Tcad_empresa_cliente.CheckListBox1Exit(Sender: TObject); begin module.tb_emprecli.edit; module.tb_emprecliPadarias.Value := CheckListBox1.Checked[1]; module.tb_emprecliSupermercados.Value := CheckListBox1.Checked[2]; module.tb_emprecliPostoGasolina.Value := CheckListBox1.Checked[3]; module.tb_emprecliPapelarias.Value := CheckListBox1.Checked[4]; module.tb_emprecliFarmacias.Value := CheckListBox1.Checked[5]; module.tb_emprecliDentista.Value := CheckListBox1.Checked[6]; module.tb_emprecliLaboratorio.Value := CheckListBox1.Checked[7]; module.tb_emprecliClinicas.Value := CheckListBox1.Checked[8]; module.tb_emprecliOpticas.Value := CheckListBox1.Checked[9]; module.tb_emprecli.post; end;
Gostei + 0
17/03/2004
Valchiria
procedure Tcad_empresa_cliente.CheckListBox1Exit(Sender: TObject); begin module.tb_emprecli.edit; module.tb_emprecliPadarias.Value := CheckListBox1.Checked[1]; module.tb_emprecliSupermercados.Value := CheckListBox1.Checked[2]; module.tb_emprecliPostoGasolina.Value := CheckListBox1.Checked[3]; module.tb_emprecliPapelarias.Value := CheckListBox1.Checked[4]; module.tb_emprecliFarmacias.Value := CheckListBox1.Checked[5]; module.tb_emprecliDentista.Value := CheckListBox1.Checked[6]; module.tb_emprecliLaboratorio.Value := CheckListBox1.Checked[7]; module.tb_emprecliClinicas.Value := CheckListBox1.Checked[8]; module.tb_emprecliOpticas.Value := CheckListBox1.Checked[9]; module.tb_emprecli.post; end;
Mui Obrigada pela atenção, mas no meu caso o que ajudou mesmo foi eu usar o DBCTRLGRID + DBCHECKBOX e depois configurar o DBCTRLGRID para Rowcount = 1 em suas propriedades...
Até Mais,
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)