TextBox.LineCount Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the total number of lines in the text box.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public int LineCount { get; }

Property Value

Type: System.Int32

The total number of lines in the text box, or –1 if layout information is not available.

If text wrapping is enabled, changing the width of the text box may change this value.

The value returned is the total number of lines in the text box, regardless of how many are currently visible.

.NET Framework
Available since 3.0
Return to top
Show: