diff --git a/xml/System.Windows.Controls/TextBox.xml b/xml/System.Windows.Controls/TextBox.xml deleted file mode 100644 index 49417bdce87..00000000000 --- a/xml/System.Windows.Controls/TextBox.xml +++ /dev/null @@ -1,1722 +0,0 @@ - - - - - - - - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Controls.Primitives.TextBoxBase - - - - System.Windows.Markup.IAddChild - - - - - System.Windows.Localizability(System.Windows.LocalizationCategory.Text) - - - System.Windows.Markup.ContentProperty("Text") - - - - Represents a control that can be used to display or edit unformatted text. - - control can contain only unformatted text in its property. The following graphic shows an example of a . - - ![TextBox screen shot](~/add/media/ss-ctl-textbox.gif "TextBox screen shot") -Example of a TextBox - - is a composite control that is composed of several encapsulated components. Consequently, some events do not bubble up to the containing control because they are handled by encapsulated child elements. Because of this, application developers should listen for the tunneling version of an event (denoted by the prefix "Preview"). - - supports unformatted text only. For applications that require support for richer content, see . For applications that need to accept passwords or other sensitive input, see . - - Horizontally and vertically aligning text within a is done with the and properties. Aligning the within the layout of the page is done with the and properties. - - The best way to hide the border around a is to set the property of the to `0`. - -> [!IMPORTANT] -> has built-in handling for the bubbling and events. Consequently, custom event handlers that listen for or events from a will not be called. If you need to respond to these events, listen for the tunneling and events instead, or register the handlers with the argument (this latter option is only available through code). Do not mark the event handled unless you deliberately want to disable native handling of these events, and be aware that this has notable effects on the control's [!INCLUDE[TLA2#tla_ui](~/includes/tla2sharptla-ui-md.md)]. - - Scrollbars are not visible on a by default. To make scrollbars visible, set the and properties to or . - - Usually the event should be used to detect whenever the text in a or changes rather then as you might expect. See [How to: Detect When Text in a TextBox Has Changed](~/docs/framework/wpf/controls/how-to-detect-when-text-in-a-textbox-has-changed.md) for an example. - -## Customizing the TextBox Control - To apply the same property settings to multiple controls, use the property. You can modify the default to give the control a unique appearance. For more information about creating a , see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](~/docs/framework/wpf/controls/customizing-the-appearance-of-an-existing-control.md). To see the parts and states that are specific to the , see [TextBox Styles and Templates](~/docs/framework/wpf/controls/textbox-styles-and-templates.md). - - Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see [Default WPF Themes](https://go.microsoft.com/fwlink/?LinkID=158252). - -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] - -## Examples - This example shows how to use the Text property to set the initial text contents of a TextBox control. - -> [!NOTE] -> Although the Extensible Application Markup Language (XAML) version of the example could use the \ tags around the text of each button's TextBox content, it is not necessary because the TextBox applies the ContentPropertyAttribute attribute to the Text property. - -```xaml - - Initial text contents of the TextBox. - -``` - -```csharp -tbSettingText.Text = "Initial text contents of the TextBox."; -``` - -```vb -tbSettingText.Text = "Initial text contents of the TextBox." -``` - - For additional examples, see the 4.0 version of this document: [TextBox Class](https://msdn.microsoft.com/library/ms617604\(v=vs.100\).aspx). - - ]]> - - - - TextBox Overview - WPF Controls Gallery Sample - - - - - - - - - Constructor - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - Initializes a new instance of the class. - To be added. - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden) - - - get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries") - - - set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries") - - - - System.Int32 - - - Gets or sets the insertion position index of the caret. - The zero-based insertion position index of the caret. - - for information on terminology like "insertion position"). Setting this property moves the caret to the specified insertion position. - - An insertion position is between either characters or element tags. - - ]]> - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Controls.CharacterCasing - - - Gets or sets how characters are cased when they are manually entered into the text box. - One of the values that specifies how manually entered characters are cased. The default is . - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|None| - - - -## Examples - The following example shows how to use the property to convert all manually entered characters to uppercase in a text box. - - [!code-xaml[TextBoxMiscSnippets_snip#CharacterCasingExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_snip/csharp/charactercasingexample.xaml#charactercasingexamplewholepage)] - - [!code-csharp[TextBoxMiscSnippets_procedural_snip#CharacterCasingCodeExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/CSharp/CharacterCasingExample.cs#charactercasingcodeexamplewholepage)] - [!code-vb[TextBoxMiscSnippets_procedural_snip#CharacterCasingCodeExampleWholePage](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/visualbasic/charactercasingexample.vb#charactercasingcodeexamplewholepage)] - - ]]> - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - Clears all the content from the text box. - To be added. - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - The zero-based index of the line to retrieve the initial character index for. - Returns the zero-based character index for the first character in the specified line. - The zero-based index for the first character in the specified line. - To be added. - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - - A point in coordinate-space for which to return an index. - - to return the nearest index if there is no character at the specified point; to return -1 if there is no character at the specified point. - Returns the zero-based index of the character that is closest to the specified point. - The index of the character that is closest to the specified point, or -1 if no valid index can be found. - To be added. - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - Returns the line index for the first line that is currently visible in the text box. - The zero-based index for the first visible line in the text box. - To be added. - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - Returns the line index for the last line that is currently visible in the text box. - The zero-based index for the last visible line in the text box. - To be added. - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - The zero-based character index for which to retrieve the associated line index. - Returns the zero-based line index for the line that contains the specified character index. - The zero-based index for the line that contains the specified character index. - To be added. - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - The zero-based line index for which to return a character count. - Returns the number of characters in the specified line. - The number of characters in the specified line. - To be added. - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.String - - - - - - The zero-based line index for which to retrieve the currently displayed text. - Returns the text that is currently displayed on the specified line. - A string containing a copy of the text currently visible on the specified line. - To be added. - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - - The zero-based character index indicating a position from which to search for the next spelling error. - One of the values that specifies the direction in which to search for the next spelling error, starting at the specified . - Returns the beginning character index for the next spelling error in the contents of the text box. - The character index for the beginning of the next spelling error in the contents of the text box, or -1 if no next spelling error exists. - To be added. - - - - - - - - PresentationFramework - 4.0.0.0 - - - Returns the rectangle for an edge of the character at the specified index. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries") - - - - System.Windows.Rect - - - - - - The zero-based character index of the character for which to retrieve the rectangle. - Returns the rectangle for the leading edge of the character at the specified index. - A rectangle for the leading edge of the character at the specified character index, or if a bounding rectangle cannot be determined. - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Rect - - - - - - - The zero-based character index of the character for which to retrieve the rectangle. - - to get the trailing edge of the character; to get the leading edge of the character. - Returns the rectangle for the leading or trailing edge of the character at the specified index. - A rectangle for an edge of the character at the specified character index, or if a bounding rectangle cannot be determined. - - - - - is negative or is greater than the length of the content. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Controls.SpellingError - - - - - - The zero-based character index of a position in content to examine for a spelling error. - Returns a object associated with any spelling error at the specified character index. - A object containing the details of the spelling error found at the character indicated by , or if no spelling error exists at the specified character. - To be added. - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - The zero-based character index of a position in content to examine for a spelling error. - Returns the length of any spelling error that includes the specified character. - The length of any spelling error that includes the character specified by charIndex, or 0 if the specified character is not part of a spelling error. - To be added. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Int32 - - - - - - The zero-based character index of a position in content to examine for a spelling error. - Returns the beginning character index for any spelling error that includes the specified character. - The beginning character index for any spelling error that includes the character specified by , or -1 if the specified character is not part of a spelling error. - To be added. - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden) - - - - System.Int32 - - - Gets the total number of lines in the text box. - The total number of lines in the text box, or -1 if layout information is not available. - - - - - - - - - - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Collections.IEnumerator - - - Gets an enumerator for the logical child elements of the . - An enumerator for the logical child elements of the . - - property returns an enumerator for a collection that contains a that is equal to the property. - - ]]> - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue(0) - - - System.Windows.Localizability(System.Windows.LocalizationCategory.None, Modifiability=System.Windows.Modifiability.Unmodifiable) - - - - System.Int32 - - - Gets or sets the maximum number of characters that can be manually entered into the text box. - The maximum number of characters that can be manually entered into the text box. The default is 0, which indicates no limit. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|None| - - - -## Examples - The following example shows how to create a with a of 500 characters. - - [!code-xaml[TextBoxMiscSnippets_snip#TextBoxExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_snip/csharp/textboxexample.xaml#textboxexamplewholepage)] - - [!code-csharp[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/CSharp/TextBoxExample.cs#textboxcodeexampleinline1)] - [!code-vb[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/visualbasic/textboxexample.vb#textboxcodeexampleinline1)] - - ]]> - - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue(2147483647) - - - - System.Int32 - - - Gets or sets the maximum number of visible lines. - The maximum number of visible lines. The default is . - - . Setting this property causes the text box to resize if the number of visible lines exceeds the limit specified by . - - This property applies only to visible lines, and does not constrain the actual number of lines. Depending on its configuration, a text box may contain additional non-visible lines that are accessible by scrolling. - - If the property is explicitly set on a , the and property values are ignored. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|| - - - -## Examples - The following example shows how to create a with a value of 5. - - [!code-xaml[TextBoxMiscSnippets_snip#TextBoxExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_snip/csharp/textboxexample.xaml#textboxexamplewholepage)] - - [!code-csharp[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/CSharp/TextBoxExample.cs#textboxcodeexampleinline1)] - [!code-vb[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/visualbasic/textboxexample.vb#textboxcodeexampleinline1)] - - ]]> - - - is less than . - - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Size - - - - - - A structure that specifies the constraints on the size of the text box. - Sizes the text box to its content. - A structure indicating the new size of the text box. - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue(1) - - - - System.Int32 - - - Gets or sets the minimum number of visible lines. - The minimum number of visible lines. The default is 1. - - . Setting this property causes the text box to resize if the number of visible lines is less than value specified by . - - If the property is explicitly set on a , the and property values are ignored. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|| - - - -## Examples - The following example shows how to create a with a value of 1. - - [!code-xaml[TextBoxMiscSnippets_snip#TextBoxExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_snip/csharp/textboxexample.xaml#textboxexamplewholepage)] - - [!code-csharp[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/CSharp/TextBoxExample.cs#textboxcodeexampleinline1)] - [!code-vb[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/visualbasic/textboxexample.vb#textboxcodeexampleinline1)] - - ]]> - - - is greater than . - - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Automation.Peers.AutomationPeer - - - - Creates and returns an object for the text box. - An object for the text box. - - . - - ]]> - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - - - Arguments for the associated event. - Called when one or more of the dependency properties that exist on the element have had their effective values changed. - - . - - ]]> - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - - - The zero-based line index of the line to scroll into view. - Scrolls the line at the specified line index into view. - - - - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - - - - The zero-based character index of the first character in the selection. - The length of the selection, in characters. - Selects a range of text in the text box. - To be added. - - or is negative. - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden) - - - - System.String - - - Gets or sets the content of the current selection in the text box. - The currently selected text in the text box. - - - - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue(0) - - - System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden) - - - - System.Int32 - - - Gets or sets a value indicating the number of characters in the current selection in the text box. - The number of characters in the current selection in the text box. The default is 0. - - - - - is set to a negative value. - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue(0) - - - System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden) - - - - System.Int32 - - - Gets or sets a character index for the beginning of the current selection. - The character index for the beginning of the current selection. - - - - - is set to a negative value. - - - - - - - - - - - - - Method - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) - - - - System.Boolean - - - - - - A serialization service manager object for this object. - Returns a value that indicates whether the effective value of the property should be serialized during serialization of the object. - - if the property should be serialized; otherwise, . - To be added. - - is . - - - - - - - - - Method - - M:System.Windows.Markup.IAddChild.AddChild(System.Object) - - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - - - An object to add as a child. - Throws an exception in all cases. - - accepts only text through the interface. - - ]]> - - - is . - In all other cases. - - - - - - - - - Method - - M:System.Windows.Markup.IAddChild.AddText(System.String) - - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Void - - - - - - A string to add to the object. - Adds the text content of a node to the object. - - instance is cast to an interface. - - ]]> - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - - System.ComponentModel.DefaultValue("") - - - System.Windows.Localizability(System.Windows.LocalizationCategory.Text) - - - - System.String - - - Gets or sets the text contents of the text box. - A string containing the text contents of the text box. The default is an empty string (""). - - . - - -## XAML Property Element Usage - -``` - - String - -``` - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|, | - - ]]> - - - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.TextAlignment - - - Gets or sets the horizontal alignment of the contents of the text box. - One of the values that specifies the horizontal alignment of the contents of the text box. The default is . - - property. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|, , | - - - -## Examples - The following example shows how to create a with a of . - - [!code-xaml[TextBoxMiscSnippets_snip#TextBoxExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_snip/csharp/textboxexample.xaml#textboxexamplewholepage)] - - [!code-csharp[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/CSharp/TextBoxExample.cs#textboxcodeexampleinline1)] - [!code-vb[TextBoxMiscSnippets_procedural_snip#TextBoxCodeExampleInline1](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxMiscSnippets_procedural_snip/visualbasic/textboxexample.vb#textboxcodeexampleinline1)] - - ]]> - - - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.TextDecorationCollection - - - Gets the text decorations to apply to the text box. - A collection that contains text decorations to apply to the text box. The default is (no text decorations applied). - - object is a visual ornamentation you can add to text. There are four types of text decorations: underline, baseline, strikethrough, and overline. For more information about text decorations, see [How to: Create a Text Decoration](~/docs/framework/wpf/advanced/how-to-create-a-text-decoration.md). - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|| - - - -## Examples - The following example shows how to set the attribute, using as the example element. - - [!code-xaml[InlineSnippets#_Inline_TextDecXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/InlineSnippets/CSharp/Window1.xaml#_inline_textdecxaml)] - - The following figure shows how this example renders. - - ![Screenshot: Text with default strikethrough effect](~/add/media/inline-textdec-strike.png "Screenshot: Text with default strikethrough effect") - - The following figures show how the , , and decorations render, respectively. - - ![Screenshot: Overline TextDecorator](~/add/media/inline-textdec-over.png "Screenshot: Overline TextDecorator") - - ![Screenshot: Default baseline effect on text](~/add/media/inline-textdec-base.png "Screenshot: Default baseline effect on text") - - ![Screenshot: Text with default underline effect](~/add/media/inline-textdec-under.png "Screenshot: Text with default underline effect") - - The following example shows how to set the property programmatically. - - [!code-csharp[InlineSnippets#_Inline_TextDec](~/samples/snippets/csharp/VS_Snippets_Wpf/InlineSnippets/CSharp/Window1.xaml.cs#_inline_textdec)] - [!code-vb[InlineSnippets#_Inline_TextDec](~/samples/snippets/visualbasic/VS_Snippets_Wpf/InlineSnippets/visualbasic/window1.xaml.vb#_inline_textdec)] - - ]]> - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - - dependency property. - - ]]> - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - To be added. - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.TextWrapping - - - Gets or sets how the text box should wrap text. - One of the values that indicates how the text box should wrap text. The default is . - - attribute to causes entered text to wrap to a new line when the edge of the control is reached, automatically expanding the height of the control to include room for a new line, if necessary. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|, | - - - -## Examples - The following example demonstrates how to set the value of this property. - - [!code-csharp[TextBoxBase_Samp#TextBoxBase12](~/samples/snippets/csharp/VS_Snippets_Wpf/TextBoxBase_Samp/CSharp/Window1.xaml.cs#textboxbase12)] - [!code-vb[TextBoxBase_Samp#TextBoxBase12](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextBoxBase_Samp/VisualBasic/Window1.xaml.vb#textboxbase12)] - - ]]> - - - - - - - - - - - Field - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.DependencyProperty - - - Identifies the dependency property. - - dependency property. - - ]]> - - - - - - - - - - - Property - - PresentationFramework - 3.0.0.0 - 4.0.0.0 - - - System.Windows.Documents.Typography - - - Gets the currently effective typography variations for the text contents of the text box. - A object that specifies the currently effective typography variations. For a list of default typography values, see . - - property is applicable only to [!INCLUDE[TLA#tla_opentype](~/includes/tlasharptla-opentype-md.md)] fonts. A typography variant has no effect on fonts that do not support the variant. For more information about this topic, see [Typography in WPF](~/docs/framework/wpf/advanced/typography-in-wpf.md). - - - -## Examples - The following example shows how to set the attribute, using as the example element. - - [!code-xaml[TextElementSnippets#_TextElement_TypogXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/TextElementSnippets/CSharp/Window1.xaml#_textelement_typogxaml)] - - The following figure shows how this example renders. - - ![Screenshot: Text with altered typography](~/add/media/textelement-typog.png "Screenshot: Text with altered typography") - - In contrast, the following figure shows how a similar example with default typographic properties renders. - - ![Screenshot: Text with altered typography](~/add/media/textelement-typog-default.png "Screenshot: Text with altered typography") - - The following example shows how to set the property programmatically. - - [!code-csharp[TextElementSnippets#_TextElement_Typog](~/samples/snippets/csharp/VS_Snippets_Wpf/TextElementSnippets/CSharp/Window1.xaml.cs#_textelement_typog)] - [!code-vb[TextElementSnippets#_TextElement_Typog](~/samples/snippets/visualbasic/VS_Snippets_Wpf/TextElementSnippets/visualbasic/window1.xaml.vb#_textelement_typog)] - - ]]> - - - - -