The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
TextBox.MinLines Property
.NET Framework 3.0
Gets or sets the minimum number of visible lines to size to.
Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
/** @property */ public int get_MinLines () /** @property */ public void set_MinLines (int value)
public function get MinLines () : int public function set MinLines (value : int)
<object MinLines="int" .../>
Property Value
An integer indicating the minimum number of lines to size to. Getting this property returns the current value of MinLines. Setting this property causes the TextBox to resize if the number of visible lines is less than value specified by MinLines. The default value is one (1).The following example shows how to create a TextBox with a MinLines of 1.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <StackPanel> <TextBox Text="Initial text in TextBox" Width="200" TextAlignment="Center" TextWrapping="Wrap" MaxLength="500" MinLines="1" MaxLines="5" /> </StackPanel> </Page>
StackPanel myStackPanel = new StackPanel(); //Create TextBox TextBox myTextBox = new TextBox(); myTextBox.Width = 200; // Put some initial text in the TextBox. myTextBox.Text = "Initial text in TextBox"; // Set the maximum characters a user can manually type // into the TextBox. myTextBox.MaxLength = 500; myTextBox.MinLines = 1; // Set the maximum number of lines the TextBox will expand to // accomidate text. Note: This does not constrain the amount of // text that can be typed. To do that, use the MaxLength property. myTextBox.MaxLines = 5; // The text typed into the box is aligned in the center. myTextBox.TextAlignment = TextAlignment.Center; // When the text reaches the edge of the box, go to the next line. myTextBox.TextWrapping = TextWrapping.Wrap; myStackPanel.Children.Add(myTextBox); this.Content = myStackPanel;
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.