16-10-2015, 09:47 PM
إقتباس :كيف لى عند حذف سطر معين به رابط من [size=large]CheckListBox1[/size] يتم حذف ذات الرابط من قاعدة البياناتPHP كود :لدى CheckListBox1 وربطه ب edit1 , edit2 ,edit3 ووضعت تلك الاكواد
procedure TForm2.FormActivate(Sender: TObject);
begin
//if ADOTable1q is not empty then
if (ADOTable1z.Text <> '') then
begin
CheckListBox1.Items.Add(adoTable1.FieldByName('z').AsString);
end;
//if ADOTable1z is not empty then
if (ADOTable1zz.Text <> '') then
begin
CheckListBox1.Items.Add(adoTable1.FieldByName('zz').AsString);
//if ADOTable1z is not empty then
end;
if (ADOTable1q.Text <> '') then
begin
CheckListBox1.Items.Add(adoTable1.FieldByName('q').AsString);
end;
ADOTable1.Close;
ADOTable1.Open;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
try
ADOTable1.Edit;
OpenDialog1.Options:=[ofHideReadOnly,ofAllowMultiSelect,ofEnableSizing];
if OpenDialog1.Execute() then
begin
CheckListBox1.Items.add(OpenDialog1.FileName);
CheckListBox1.ItemIndex := CheckListBox1.Items.Count -1 ;
//Do Something ...
end;
except
exit;
end;
end;
procedure TForm2.CheckListBox1Click(Sender: TObject);
begin
try
//if ADOTable1q is not empty then
if (ADOTable1q.Text <> '') and (ADOTable1z.Text <> '') and (ADOTable1zz.Text <> '')then
begin
end
else
begin
if (ADOTable1q.Text <> '') and (ADOTable1z.Text <> '') then
begin
dbEdit24.Text := CheckListBox1.Items[CheckListBox1.ItemIndex];
end
else
begin
//if ADOTable1q is not empty then
if (ADOTable1q.Text <> '') then
begin
dbEdit23.Text := CheckListBox1.Items[CheckListBox1.ItemIndex];
end
else
begin
dbEdit22.Text := CheckListBox1.Items[CheckListBox1.ItemIndex];
end;
begin
end;
end;
end;
except
exit;
end;
end;
procedure TForm2.CheckListBox1DblClick(Sender: TObject);
begin
if (DataSource1.State =dsinsert)or (DataSource1.State =dsEdit) then
begin
ADOTable1.Post;
end
else
begin
ShellExecute(Handle,'open',PChar(CheckListBox1.Items.Strings[CheckListBox1.ItemIndex]),nil,nil, SW_SHOWNORMAL);
end;
end;
وشكراً لكم