Home > Back-end >  Delphi practice notes, statistics of the current DBGrid record total, copy and paste multiple lines,
Delphi practice notes, statistics of the current DBGrid record total, copy and paste multiple lines,

Time:10-04

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Statistical current DBGrid record number:
GSHJ. Caption:=inttostr (tempTable RecordCount);
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 8
Filtering
ZgxxTable. Filtered:=false;
ZgxxTable. Filter:='zl<> Null ';
If zlfrom_edit. Text & lt;> "' then
Zgxxtable. Filter:=zgxxtable. Filter + 'and zl>='+ trim (zlfrom_edit. Text);
If zlto_edit. Text & lt;> "' then
Zgxxtable. Filter:=zgxxtable. Filter + 'and zl<='+ trim (zlto_edit. Text);
Zgxxtable. Filtered:=true;

Procedure TFgrclgz_win. ToolButtonCopyClick (Sender: TObject); Three copies of the
Var
STR: string;
The begin
ToolButtonEditClick (nil);
If InputQuery (' prompt ', 'card number: please enter a new circulation, STR) then
The begin
If the trim (STR)='then
The begin
MessageDlg (' circulation card can't be empty! ', mtInformation, [mbOk], 0);
exit;
End
The else
The begin
Flag:=1;
CDSM. Edit;
CDSM. FieldByName (' LZKH). AsString:=STR;
end;
end;

end;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copy and paste the multi-line interface USE - DBGridEhImpExp -- -- -- -- -- -- -- parent form
Procedure Tmodal_win. MenuItem17Click (Sender: TObject);
The begin
Syt. The cut;
end;

Procedure Tmodal_win. N9Click (Sender: TObject);
The begin
Syt. Copy;
end;

Procedure Tmodal_win. N10Click (Sender: TObject);
The begin
Syt. Paste;
end;

Procedure Tmodal_win. N12Click (Sender: TObject);
Var
DBGridEh: TDBGriDEH;
The begin
If screen. ActiveForm. Activecontrol is TDBGriDEH then
The begin
DBGridEh:=screen. ActiveForm. Activecontrol as TDBGriDEH;
If DBGridEh. The DataSource. The DataSet. The Active=true then
DBGridEh. The DataSource. The DataSet. Insert;
end;
end;

Procedure Tmodal_win. N13Click (Sender: TObject);
Var
DBGridEh: TDBGriDEH;
The begin
If screen. ActiveForm. Activecontrol is TDBGriDEH then
The begin
DBGridEh:=screen. ActiveForm. Activecontrol as TDBGriDEH;
If DBGridEh. The DataSource. The DataSet. The Active=true then
DBGridEh. The DataSource. The DataSet. Append;
end;
end;


Procedure Tmodal_win. N14Click (Sender: TObject);
Var
DBGridEh: TDBGriDEH;
The begin
Delete the current record if MessageDlg ('? ', mtInformation, [mbyes, mbno], 0)=mryes then
The begin
If screen. ActiveForm. Activecontrol is TDBGriDEH then
The begin
DBGridEh:=screen. ActiveForm. Activecontrol as TDBGriDEH;
If (DBGridEh DataSource. The DataSet. The Active=true)
And (DBGridEh DataSource. The DataSet. RecordCount & gt; 0) then
DBGridEh. The DataSource. The DataSet. Delete;
end;
end;
end;

Procedure Tmodal_win. N15Click (Sender: TObject);
Var
DBGridEh: TDBGriDEH;
The begin
If screen. ActiveForm. Activecontrol is TDBGriDEH then
The begin
DBGridEh:=screen. ActiveForm. Activecontrol as TDBGriDEH;
If DBGridEh. The DataSource. The DataSet. The Active=true then
Syt. Copyoneline (DBGridEh);
end;

end;

Procedure Tmodal_win. N16Click (Sender: TObject);
Var
DBGridEh: TDBGriDEH;
The begin
If screen. ActiveForm. Activecontrol is TDBGriDEH then
The begin
DBGridEh:=screen. ActiveForm. Activecontrol as TDBGriDEH;
If DBGridEh. The DataSource. The DataSet. The Active=true then
Syt. Pasteoneline (DBGridEh);
end;

end;

Procedure Tmodal_win. N35Click (Sender: TObject);
The begin
Try
If (Activecontrol is TDBGriDEH) then
With TDBGriDEH (Activecontrol) do
If CheckCutAction and (geaCutEh EditActions) in then
DBGridEh_DoCutAction (TDBGriDEH (Activecontrol), false);
Except,
MessageDlg (' data exception! ', mtInformation, [mbOk], 0);
exit;
end;

end;

Procedure Tmodal_win. N34Click (Sender: TObject);
The begin
Try
If (Activecontrol is TDBGriDEH) then
With TDBGriDEH (Activecontrol) do
If CheckCopyAction and (geaCopyEh EditActions) in then
DBGridEh_DoCopyAction (TDBGriDEH (Activecontrol), false);
Except,
MessageDlg (' data exception! ', mtInformation, [mbOk], 0);
exit;
end;
end;

Procedure Tmodal_win. N31Click (Sender: TObject);
The begin
Try
If (Activecontrol is TDBGriDEH) then
With TDBGriDEH (Activecontrol) do
The begin
If CheckPasteAction and (geaPasteEh EditActions) in then
DBGridEh_DoPasteAction (TDBGriDEH (Activecontrol), false);
end;
Except,
MessageDlg (' data exception! ', mtInformation, [mbOk], 0);
exit;
end;
end;

Procedure Tmodal_win. N36Click (Sender: TObject);
The begin
Try
If (Activecontrol is TDBGriDEH) then
With TDBGriDEH (Activecontrol) do
If CheckDeleteAction and (geaDeleteEh EditActions) in then
DBGridEh_DoDeleteAction (TDBGriDEH (Activecontrol), false);
Except,
MessageDlg (' data exception! ', mtInformation, [mbOk], 0);
exit;
end;
end;

Procedure Tmodal_win. N37Click (Sender: TObject); nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related