Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Italic Constructor (TextPointer, TextPointer)

Italic Constructor (TextPointer, TextPointer)

Initializes a new instance of the Italic class with the specified TextPointer objects that indicate the beginning and end of a content selection that the new Italic will contain.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

'Declaration
Public Sub New ( _
	start As TextPointer, _
	end As TextPointer _
)

Parameters

start
Type: System.Windows.Documents.TextPointer

The beginning of a selection of content that the new Italic will contain.

end
Type: System.Windows.Documents.TextPointer

The end of a selection of content that the new Italic will contain.

ExceptionCondition
ArgumentNullException

start or end is Nothing.

ArgumentException

start and end do not resolve to a range of content suitable for enclosure by an Italic element; for example, if start and end indicate positions in different paragraphs.

The following example demonstrates usage of this constructor.

' Create a paragraph and three text runs to serve as example content.  
Dim parx As New Paragraph()
Dim run1 As New Run("Text run 1.")
Dim run2 As New Run("Text run 2, make italic.")
Dim run3 As New Run("Text run 3.")

' Add the three text runs to the paragraph, separated by linebreaks.
parx.Inlines.Add(run1)
parx.Inlines.Add(New LineBreak())
parx.Inlines.Add(run2)
parx.Inlines.Add(New LineBreak())
parx.Inlines.Add(run3)

' After this line executes, the selection of content
' indicated by the "start" and "end" parameters will be
' enclosed by the new Italic.  In this case, the new Italic
' will enclose the second text run, "run2".
Dim italx3 As New Italic(run2.ContentStart, run2.ContentEnd)

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft