DelphiFAQ Home Search:
General :: Windows :: Programming :: Windows with Delphi :: Windows API
Windows programming with Delphi

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Copy from the active control to the clipboard

Use the following piece of code for this.

Note: You may trigger the menu open event and enable/ disable the
copy/ paste menu items depending on the type of control that is active.

procedure CopyButtonClick(Sender: TObject);
 begin
   if ActiveControl is TMemo then TMemo(ActiveControl).CopyToClipboard;
   if ActiveControl is TDBMemo then TDBMemo(ActiveControl).CopyToClipboard;
   if ActiveControl is TEdit then TEdit(ActiveControl).CopyToClipboard;
   if ActiveControl is TDBedit then TDBedit(ActiveControl).CopyToClipboard;
 end;
  
 procedure PasteButtonClick(Sender: TObject);
 begin
   if ActiveControl is TMemo then TMemo(ActiveControl).PasteFromClipboard;
   if ActiveControl is TDBMemo then TDBMemo(ActiveControl).PasteFromClipboard;
   if ActiveControl is TEdit then TEdit(ActiveControl).PasteFromClipboard;
   if ActiveControl is TDBedit then TDBedit(ActiveControl).PasteFromClipboard;
 end;

Generated 20:01:58 on Aug 3, 2020