Clipboard Persistence

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We are adding clipboard support for an exception handler we use, so users can
paste the information about the exception into an email or document. I am
using the following method:

Clipboard.SetDataObject(sb.ToString()); (after building the stringbuilder of
course)

The problem is, once the application is closed, the clipboard is emptied.
Is there any way to make it persistent? Do I need to use the WIndows API
instead of the .NET?

Thanks in advance for the help.
 
Hi,

Use the overload of the SetDataObject method passing true as the 2nd argument:

Clipboard.SetDataObject(sb.ToString(),true);

See MSDN documentation for this method.

Best regards,

Rodger

Sequence Diagram Editor - Draw sequence diagrams faster
<http://www.SequenceDiagramEditor.com>
 
Back
Top