Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AnnotationHelper.CreateTextStickyNoteForSelection Method

Creates a text sticky note annotation on the current selection of the viewer control associated with the specified AnnotationService.

Namespace: System.Windows.Annotations
Assembly: PresentationFramework (in presentationframework.dll)

public static Annotation CreateTextStickyNoteForSelection (
	AnnotationService service,
	string author
)
public static Annotation CreateTextStickyNoteForSelection (
	AnnotationService service, 
	String author
)
public static function CreateTextStickyNoteForSelection (
	service : AnnotationService, 
	author : String
) : Annotation
You cannot use methods in XAML.

Parameters

service

The annotation service to use to create the text sticky note annotation.

author

The author of the annotation.

Return Value

The text sticky note annotation; or a null reference (Nothing in Visual Basic), if there is no selected content to annotate.

Exception typeCondition

ArgumentNullException

service is a null reference (Nothing in Visual Basic).

ArgumentException

service is not enabled.

InvalidOperationException

The viewer control contains no content selection.

The text sticky note annotation is anchored to the content defined by the current selection of the DocumentViewerBase, DocumentViewer, FlowDocumentPageViewer, FlowDocumentScrollViewer, or FlowDocumentReader control specified to the AnnotationService constructor.

If there is no user-selected content (the selection length is zero length), no annotation is created and an InvalidOperationException is thrown.

author can be specified as a null reference (Nothing in Visual Basic) in which case no author is defined.

The given annotation service must be enabled by means of a call to AnnotationService.Enable prior to calling CreateTextStickyNoteForSelection.

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.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft