Ink.ClipboardCopy Method (InkClipboardFormats, InkClipboardModes)
Copies the Ink object to the Clipboard.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)
Syntax
'Declaration
Public Function ClipboardCopy ( _
formats As InkClipboardFormats, _
modes As InkClipboardModes _
) As IDataObject
'Usage
Dim instance As Ink
Dim formats As InkClipboardFormats
Dim modes As InkClipboardModes
Dim returnValue As IDataObject
returnValue = instance.ClipboardCopy(formats, modes)
public IDataObject ClipboardCopy (
InkClipboardFormats formats,
InkClipboardModes modes
)
public:
IDataObject^ ClipboardCopy (
InkClipboardFormats formats,
InkClipboardModes modes
)
public IDataObject ClipboardCopy (
InkClipboardFormats formats,
InkClipboardModes modes
)
public function ClipboardCopy (
formats : InkClipboardFormats,
modes : InkClipboardModes
) : IDataObject
Not applicable.
Parameters
- formats
A member of the InkClipboardFormats enumeration that specifies the format for the Ink object. The default value is Default.
- modes
A member of the InkClipboardModes enumeration that specifies the mode for the Ink object. The default value is Default.
Return Value
The data object to be created. The default value is a null reference (Nothing in Visual Basic) (Nothing in Microsoft Visual Basic.NET).
Remarks
This method copies the Ink object to the Clipboard, including the CustomStrokes property. In addition, the RecognitionResult property of strokes in the Ink object's CustomStrokes collection is maintained.
If the Ink object's Strokes collection is empty, the method returns a null reference (Nothing in Visual Basic) (Nothing in Visual Basic .NET), and the contents of the Clipboard are not modified.
Warning
To avoid potential memory leaks as a result of using the InkClipboardModes flag, call the SetDataObject method of the Clipboard object. This must be done before the application exits if the last call to the ClipboardCopy method used the DelayedCopy flag in enumeration InkClipboardModes.
Security Note: |
---|
If using under partial trust, this method requires UIPermissionClipboard.OwnClipboardUIPermissionClipboard.OwnClipboard permission. See Security And Trust for more information. |
Example
This C# example uses a menu's click event handler to copy all of the ink from the InkCollector object, theInkCollector
, to the Clipboard.
private void menuEditCopyAll_Click(object sender, EventArgs e)
{
try
{
theInkCollector.Ink.ClipboardCopy(InkClipboardFormats.Default,
InkClipboardModes.Copy);
}
catch
{
// Place exception handling code here.
}
}
This Visual Basic .NET example uses a menu's click event handler to copy all of the ink from the InkCollector object, theInkCollector
, to the Clipboard.
Private Sub menuEditCopy_Click(Dim sender As Object, Dim e As EventArgs)
Try
theInkCollector.Ink.ClipboardCopy(InkClipboardFormats.Default, _
InkClipboardModes.Copy)
Catch
'Place exception handling code here.
End Try
End Sub
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
Ink Class
Ink Members
Microsoft.Ink Namespace
ClipboardPaste