Table of Contents

Class ScrollablePanelBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for scrollable panel controls

public sealed class ScrollablePanelBuilder
Inheritance
ScrollablePanelBuilder
Inherited Members

Methods

AddControl(IWindowControl)

Adds a child control to the panel

public ScrollablePanelBuilder AddControl(IWindowControl control)

Parameters

control IWindowControl

The control to add

Returns

ScrollablePanelBuilder

The builder for chaining

Build()

Builds the scrollable panel control

public ScrollablePanelControl Build()

Returns

ScrollablePanelControl

The configured control

OnGotFocus(EventHandler)

Attaches a handler for the GotFocus event

public ScrollablePanelBuilder OnGotFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler

Returns

ScrollablePanelBuilder

The builder for chaining

OnLostFocus(EventHandler)

Attaches a handler for the LostFocus event

public ScrollablePanelBuilder OnLostFocus(EventHandler handler)

Parameters

handler EventHandler

The event handler

Returns

ScrollablePanelBuilder

The builder for chaining

OnScrolled(EventHandler<ScrollEventArgs>)

Attaches a handler for the Scrolled event

public ScrollablePanelBuilder OnScrolled(EventHandler<ScrollEventArgs> handler)

Parameters

handler EventHandler<ScrollEventArgs>

The event handler

Returns

ScrollablePanelBuilder

The builder for chaining

ScrollbarLeft()

Sets the scrollbar position to left

public ScrollablePanelBuilder ScrollbarLeft()

Returns

ScrollablePanelBuilder

The builder for chaining

ScrollbarRight()

Sets the scrollbar position to right

public ScrollablePanelBuilder ScrollbarRight()

Returns

ScrollablePanelBuilder

The builder for chaining

StickyBottom()

Makes the control stick to the bottom of the window

public ScrollablePanelBuilder StickyBottom()

Returns

ScrollablePanelBuilder

The builder for chaining

StickyTop()

Makes the control stick to the top of the window

public ScrollablePanelBuilder StickyTop()

Returns

ScrollablePanelBuilder

The builder for chaining

Visible(bool)

Sets the visibility

public ScrollablePanelBuilder Visible(bool visible = true)

Parameters

visible bool

True if visible

Returns

ScrollablePanelBuilder

The builder for chaining

WithAlignment(HorizontalAlignment)

Sets the horizontal alignment

public ScrollablePanelBuilder WithAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

The alignment

Returns

ScrollablePanelBuilder

The builder for chaining

WithAutoScroll(bool)

Enables or disables automatic scrolling to bottom when content is added. When enabled, new content auto-scrolls to bottom if already at bottom, disables when user scrolls up, and re-enables when user scrolls to bottom.

public ScrollablePanelBuilder WithAutoScroll(bool enabled = true)

Parameters

enabled bool

True to enable auto-scroll

Returns

ScrollablePanelBuilder

The builder for chaining

WithBackgroundColor(Color)

Sets the background color

public ScrollablePanelBuilder WithBackgroundColor(Color color)

Parameters

color Color

The background color

Returns

ScrollablePanelBuilder

The builder for chaining

WithColors(Color, Color)

Sets both foreground and background colors

public ScrollablePanelBuilder WithColors(Color foreground, Color background)

Parameters

foreground Color

The foreground color

background Color

The background color

Returns

ScrollablePanelBuilder

The builder for chaining

WithForegroundColor(Color)

Sets the foreground color

public ScrollablePanelBuilder WithForegroundColor(Color color)

Parameters

color Color

The foreground color

Returns

ScrollablePanelBuilder

The builder for chaining

WithHorizontalScroll(ScrollMode)

Sets the horizontal scroll mode

public ScrollablePanelBuilder WithHorizontalScroll(ScrollMode mode = ScrollMode.Scroll)

Parameters

mode ScrollMode

The scroll mode (None, Scroll, or Wrap)

Returns

ScrollablePanelBuilder

The builder for chaining

WithMargin(Margin)

Sets the margin

public ScrollablePanelBuilder WithMargin(Margin margin)

Parameters

margin Margin

The margin

Returns

ScrollablePanelBuilder

The builder for chaining

WithMargin(int)

Sets uniform margin on all sides

public ScrollablePanelBuilder WithMargin(int margin)

Parameters

margin int

The margin value

Returns

ScrollablePanelBuilder

The builder for chaining

WithMargin(int, int, int, int)

Sets the margin

public ScrollablePanelBuilder WithMargin(int left, int top, int right, int bottom)

Parameters

left int

Left margin

top int

Top margin

right int

Right margin

bottom int

Bottom margin

Returns

ScrollablePanelBuilder

The builder for chaining

WithMouseWheel(bool)

Sets whether mouse wheel scrolling is enabled

public ScrollablePanelBuilder WithMouseWheel(bool enable = true)

Parameters

enable bool

True to enable mouse wheel scrolling

Returns

ScrollablePanelBuilder

The builder for chaining

WithName(string)

Sets the control name for FindControl queries

public ScrollablePanelBuilder WithName(string name)

Parameters

name string

The control name

Returns

ScrollablePanelBuilder

The builder for chaining

WithScrollbar(bool)

Sets whether to show the scrollbar

public ScrollablePanelBuilder WithScrollbar(bool show = true)

Parameters

show bool

True to show scrollbar

Returns

ScrollablePanelBuilder

The builder for chaining

WithScrollbarPosition(ScrollbarPosition)

Sets the scrollbar position

public ScrollablePanelBuilder WithScrollbarPosition(ScrollbarPosition position)

Parameters

position ScrollbarPosition

The scrollbar position (Left or Right)

Returns

ScrollablePanelBuilder

The builder for chaining

WithStickyPosition(StickyPosition)

Sets the sticky position

public ScrollablePanelBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

The sticky position

Returns

ScrollablePanelBuilder

The builder for chaining

WithTag(object)

Sets the control tag for custom data storage

public ScrollablePanelBuilder WithTag(object tag)

Parameters

tag object

The tag object

Returns

ScrollablePanelBuilder

The builder for chaining

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment

public ScrollablePanelBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

The vertical alignment

Returns

ScrollablePanelBuilder

The builder for chaining

WithVerticalScroll(ScrollMode)

Sets the vertical scroll mode

public ScrollablePanelBuilder WithVerticalScroll(ScrollMode mode = ScrollMode.Scroll)

Parameters

mode ScrollMode

The scroll mode (None, Scroll, or Wrap)

Returns

ScrollablePanelBuilder

The builder for chaining

WithWidth(int)

Sets the width

public ScrollablePanelBuilder WithWidth(int width)

Parameters

width int

The width

Returns

ScrollablePanelBuilder

The builder for chaining

Operators

implicit operator ScrollablePanelControl(ScrollablePanelBuilder)

Implicit conversion to ScrollablePanelControl

public static implicit operator ScrollablePanelControl(ScrollablePanelBuilder builder)

Parameters

builder ScrollablePanelBuilder

Returns

ScrollablePanelControl