FormatCount (Delphi)
Description
When Button1 is clicked, the following code adds each format on the Clipboard to ListBox1. To make Formats work, something must be on the Clipboard. Load the Clipboard by doing a Paste in another window.
Note: You need to add Clipbrd to the uses clause (Delphi) or to include <Clipbrd.hpp> (C++).
Code
uses clipbrd;
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
begin
for I := 0 to Clipboard.FormatCount - 1 do
ListBox1.Items.Add(IntToStr(Clipboard.Formats[I]));
end;
Uses
- Vcl.Clipbrd.TClipboard.FormatCount ( fr | de | ja )
- Vcl.Clipbrd.TClipboard.Formats ( fr | de | ja )