ScrollbarMode HorizontalScrollbarMode { get; set; }

robot_2Generated
code_blocksInput

Description

The HorizontalScrollbarMode property of the TextEdit class specifies the behavior of the horizontal scrollbar within the text editor widget. It determines how and when the horizontal scrollbar is displayed based on the content and the size of the text editor.

Usage

To use the HorizontalScrollbarMode property, you can get or set its value to control the visibility and behavior of the horizontal scrollbar in a TextEdit instance. The property accepts values from the Editor.ScrollbarMode enumeration, which typically includes options such as AlwaysOff, AlwaysOn, and Auto.

For example, setting the property to Editor.ScrollbarMode.Auto will make the scrollbar appear only when the text content exceeds the visible area of the text editor horizontally.

Example

// Example of setting the HorizontalScrollbarMode property
TextEdit textEdit = new TextEdit();
textEdit.HorizontalScrollbarMode = Editor.ScrollbarMode.Auto;

// This will ensure the horizontal scrollbar appears only when necessary.