Adding the Clipboard Object
Go Up to Working with Text in Controls
Most text-handling applications provide users with a way to move selected text between documents, including documents in different applications. TClipboard object encapsulates a clipboard (such as the Windows Clipboard) and includes methods for cutting, copying, and pasting text (and other formats, including graphics). The Clipboard object is declared in the Clipbrd unit.
To add the Clipboard object to an application (Delphi)
- Select the unit that will use the clipboard.
- Search for the implementation reserved word.
- Add Clipbrd to the uses clause below implementation.
- If there is already a uses clause in the implementation part, add Clipbrd to the end of it.
- If there is not already a uses clause, add one that says
uses Clipbrd;
For example, in an application with a child window, the uses clause in the unit's implementation part might look like this:
uses
MDIFrame, Clipbrd;
To add the Clipboard object to an application (C++)
- Select the unit that will use the clipboard.
- In the form's header file (
.h
), add
#include <vcl\Clipbrd.hpp>