mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 23:43:39 +02:00
* 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
29 lines
1.4 KiB
Markdown
29 lines
1.4 KiB
Markdown
---
|
|
title: "How to: Insert an Element Into Text Programmatically"
|
|
ms.date: "03/30/2017"
|
|
dev_langs:
|
|
- "csharp"
|
|
- "vb"
|
|
helpviewer_keywords:
|
|
- "Text Animation sample [WPF]"
|
|
- "elements [WPF], inserting into text"
|
|
- "inserting elements into text [WPF]"
|
|
- "TextPointer objects [WPF]"
|
|
- "text [WPF], inserting elements"
|
|
ms.assetid: 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-csharp[FlowMiscSnippets_procedural_snip#InsertInlineIntoTextExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/FlowMiscSnippets_procedural_snip/CSharp/InsertInlineIntoTextExample.cs#insertinlineintotextexamplewholepage)]
|
|
[!code-vb[FlowMiscSnippets_procedural_snip#InsertInlineIntoTextExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/FlowMiscSnippets_procedural_snip/VisualBasic/InsertInlineIntoTextExample.vb#insertinlineintotextexamplewholepage)]
|
|
|
|
The illustration below shows what this example looks like.
|
|
|
|

|
|
|
|
## See also
|
|
|
|
- [Flow Document Overview](flow-document-overview.md)
|