--- title: "How to: Manipulate Flow Content Elements through the Inlines Property" ms.date: "03/30/2017" ms.custom: devdivchpfy22 description: Learn how to manipulate Flow Content Elements through the Inlines property. dev_langs: - "csharp" - "vb" helpviewer_keywords: - "flow content elements [WPF], manipulating through Inlines property" - "documents [WPF], manipulating flow Content elements through Inlines property" - "Inlines property [WPF], manipulating flow Content elements" - "properties [WPF], Inlines [WPF], manipulating flow Content elements" ms.assetid: 510780d2-3da1-4360-8763-7054bda22ea3 --- # How to: Manipulate Flow Content Elements through the Inlines Property These examples demonstrate some of the more common operations that can be performed on inline flow content elements (and containers of such elements, such as ) through the **Inlines** property. This property is used to add and remove items from . Flow content elements that feature an **Inlines** property include: - - - - - - These examples happen to use as the flow content element, but these techniques are applicable to all elements or controls that host an collection. ## Create a new Span object The following example creates a new object, and then uses the **Add** method to add two text runs as content children of the . [!code-csharp[SpanSnippets#_SpanInlinesAdd](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesadd)] [!code-vb[SpanSnippets#_SpanInlinesAdd](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesadd)] ## Create a new Run element The following example creates a new element and inserts it at the beginning of the . [!code-csharp[SpanSnippets#_SpanInlinesInsert](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesinsert)] [!code-vb[SpanSnippets#_SpanInlinesInsert](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesinsert)] ## Get the top-level Inline elements in the Span The following example gets the number of top-level elements contained in the . [!code-csharp[SpanSnippets#_SpanInlinesCount](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinescount)] [!code-vb[SpanSnippets#_SpanInlinesCount](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinescount)] ## Delete the last Inline element in the Span The following example deletes the last element in the . [!code-csharp[SpanSnippets#_SpanInlinesRemoveLast](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesremovelast)] [!code-vb[SpanSnippets#_SpanInlinesRemoveLast](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesremovelast)] ## Clear all the Inline element content from the Span The following example clears all of the contents ( elements) from the . [!code-csharp[SpanSnippets#_SpanInlinesClear](~/samples/snippets/csharp/VS_Snippets_Wpf/SpanSnippets/CSharp/Window1.xaml.cs#_spaninlinesclear)] [!code-vb[SpanSnippets#_SpanInlinesClear](~/samples/snippets/visualbasic/VS_Snippets_Wpf/SpanSnippets/visualbasic/window1.xaml.vb#_spaninlinesclear)] ## See also - - - - [Flow Document Overview](flow-document-overview.md) - [Manipulate a FlowDocument through the Blocks Property](how-to-manipulate-a-flowdocument-through-the-blocks-property.md) - [Manipulate a Table's Columns through the Columns Property](how-to-manipulate-table-columns-through-the-columns-property.md) - [Manipulate a Table's Row Groups through the RowGroups Property](how-to-manipulate-table-row-groups-through-the-rowgroups-property.md)