Version

SetDataObject(Object,Boolean,Int32,Int32) Method

Places a data object on the clipboard and conditionally leaves it on the clipboard when the application exits.
Syntax
'Declaration
 
Public Overloads Shared Function SetDataObject( _
   ByVal data As Object, _
   ByVal copy As Boolean, _
   ByVal retryTimes As Integer, _
   ByVal retryDelay As Integer _
) As Boolean
public static bool SetDataObject( 
   object data,
   bool copy,
   int retryTimes,
   int retryDelay
)

Parameters

data
The data object to place on the clipboard
copy
True to leave the data on the system clipboard when the application exits.
retryTimes
The number of times to retry placing the data on the clipboard
retryDelay
The number of milliseconds to pause between attempts
Exceptions
ExceptionDescription
System.ArgumentNullExceptiondata is null
System.ArgumentOutOfRangeExceptionretryTimes or retryDelay is less than zero.
System.Runtime.InteropServices.ExternalExceptionData could not be placed on the clipboard
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also