Table of Contents

Class LayoutExtensions

Namespace
NanoByte.Common.EtoControls
Assembly
NanoByte.Common.EtoForms.dll

Provides extension methods for laying out wrapped text.

public static class LayoutExtensions
Inheritance
object
LayoutExtensions

Methods

FitContentHeight(Window, int)

Gives a window a fixed client width and sizes its height to fit its content at that width.

public static void FitContentHeight(this Window window, int clientWidth)

Parameters

window Window

The window to size.

clientWidth int

The width of the window's client area.

Remarks

Use this instead of setting only Eto.Forms.Control.Width or ClientSize for windows with wrapped Eto.Forms.Labels. Some platforms (e.g., the Windows Forms backend) otherwise grow such windows to fit the text on a single line.

ReflowOnResize(Label)

Makes the layout containing a wrapped label recalculate the label's height whenever its width changes, e.g., when the user resizes the window.

public static Label ReflowOnResize(this Label label)

Parameters

label Label

The label to watch.

Returns

Label

The same label, for use in object initializers.

Remarks

Some platforms (e.g., the Windows Forms backend) otherwise keep the height the label had for its previous width, cutting off text.