Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-insert-an-element-into-text-programmatically.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.4 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Insert an Element Into Text Programmatically 03/30/2017
csharp
vb
Text Animation sample [WPF]
elements [WPF], inserting into text
inserting elements into text [WPF]
TextPointer objects [WPF]
text [WPF], inserting elements
97bd950a-25ac-4e42-a311-94b6420d4136

How to: Insert an Element Into Text Programmatically

The following example shows how to use two xref:System.Windows.Documents.TextPointer objects to specify a range within text to apply a xref:System.Windows.Documents.Span element to.

Example

[!code-csharpFlowMiscSnippets_procedural_snip#InsertInlineIntoTextExampleWholePage] [!code-vbFlowMiscSnippets_procedural_snip#InsertInlineIntoTextExampleWholePage]

The illustration below shows what this example looks like.

A Span element applied to a range of text

See also