Table of Contents

Property ScrollOffset

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

ScrollOffset

Gets the horizontal scroll offset, representing the index of the first visible text element.

public int ScrollOffset { get; }

Property Value

int

A 0-based index into the text elements indicating which element appears at the left edge of the viewport.

Remarks

When the text is longer than the viewport width, this property tracks how far the view has scrolled. The Terminal.Gui.Views.TextField.Adjust() method automatically updates this value to keep the cursor visible.

Relationship to cursor positioning:

Example: For text "Hello World" with viewport width 5:

  • ScrollOffset = 0: Shows "Hello"
  • ScrollOffset = 6: Shows "World"
See Also