Partager via


RichTextBox.VerticalScrollBarVisibility Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the visibility of the vertical scroll bar.

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

Syntax

'Declaration
Public Property VerticalScrollBarVisibility As ScrollBarVisibility
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
<RichTextBox VerticalScrollBarVisibility="scrollBarVisibilityValue"/>

XAML Values

  • scrollBarVisibilityValue
    A named constant of the ScrollBarVisibility enumeration, such as Disabled.

Property Value

Type: System.Windows.Controls.ScrollBarVisibility
The visibility of the vertical scroll bar. The default is Auto.

Remarks

If the VerticalScrollBarVisibility property is set to Disabled, the RichTextBox does not scroll vertically.

Examples

The following XAML shows how to use the VerticalScrollBarVisibility property.

<RichTextBox Margin="20,20,0,0" Width="300" Height="50" AcceptsReturn="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">
    <Paragraph>
        A RichTextBox that demonstrates HorizontalScrollBarVisibility and VerticalScrollBarVisibility
    </Paragraph>
</RichTextBox>

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.