clipboard OnChange events
Return to Introduction  Previous page  Next page
Applies to
acClipboard  

Declaration
property OnChange: TNotifyEvent;  

Description
The OnChange event occurs when the content of the clipboard changes.  
 
Write the OnChange event handler to display the new content in the clipboard viewer window, or refresh the "Paste" menu items and buttons when the data with compatible format appears or disappears from the clipboard.  

Note
iiwarning The OnChange event only occurs if Active property is True. Set Active to True if you wish to monitor the clipboard for changes, or set it to False to disable monitoring.  

Example
procedure TacFormHelpEditor.acClipboard1Change(Sender: TObject);  
begin  
  PasteTextItem.Enabled := acClipboard1.HasFormat(CF_TEXT);  
 
  // here is an alternative  
  PasteBitmapItem := acClipboard1.HasFormat('BITMAP'); // <-- you can specify format name as string  
end;  

See also
Active and AvailableFormats properties;  
HasFormat, GetString and PutString methods;  
OnChange event.