mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +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
1.2 KiB
1.2 KiB
title, ms.date, helpviewer_keywords, ms.assetid
| title | ms.date | helpviewer_keywords | ms.assetid | ||
|---|---|---|---|---|---|
| How to: Get a Collection of Lines from a TextBox | 03/30/2017 |
|
a12f529d-b926-47f6-92bf-cad5f17b532a |
How to: Get a Collection of Lines from a TextBox
This example shows how to get a collection of lines of text from a xref:System.Windows.Controls.TextBox.
Example
The following example shows a simple method that takes a xref:System.Windows.Controls.TextBox as the argument, and returns a xref:System.Collections.Specialized.StringCollection containing the lines of text in the TextBox. The xref:System.Windows.Controls.TextBox.LineCount%2A property is used to determine how many lines are currently in the TextBox, and the xref:System.Windows.Controls.TextBox.GetLineText%2A method is then used to extract each line and add it to the collection of lines.
[!code-csharpTextBox_MiscCode#_TextBox_GetLines]