Show / Hide Table of Contents

KryptonWrapLabel

Overview

KryptonWrapLabel extends Label with Krypton palette fonts, colors, and word wrapping. Use it for descriptive text that must wrap within a fixed width while staying on-theme.

Namespace: Krypton.Toolkit
Assembly: Krypton.Toolkit
Default property: Text
Inheritance: Label → KryptonWrapLabel

Key features

  • LabelStyle and palette content integration
  • StateCommon, StateNormal, StateDisabled
  • PaletteMode / Palette with PaletteChanged event
  • Target for forwarding mnemonics and clicks
  • KryptonContextMenu support
  • AutoSize with wrapping behavior

Constructor

public KryptonWrapLabel()

Properties

LabelStyle

public LabelStyle LabelStyle { get; set; }

Default: LabelStyle.NormalPanel (set in constructor). Controls font and color mapping from the palette.

PaletteMode / Palette

[DefaultValue(PaletteMode.Global)]
public PaletteMode PaletteMode { get; set; }

public PaletteBase? Palette { get; set; }

Theme source; ResetPaletteMode() / ResetPalette() restore global palette.

StateCommon / StateNormal / StateDisabled

public PaletteWrapLabel StateCommon { get; }
public PaletteWrapLabel StateDisabled { get; }
public PaletteWrapLabel StateNormal { get; }

Content and short-text overrides per state.

Target

[DefaultValue(null)]
public Control? Target { get; set; }

Optional control that receives mnemonic activation and click forwarding.

KryptonContextMenu

public KryptonContextMenu? KryptonContextMenu { get; set; }

Themed context menu on right-click.

Renderer

public IRenderer? Renderer { get; }

Resolved renderer from the active palette.

Events

PaletteChanged

public event EventHandler? PaletteChanged;

Raised when Palette or PaletteMode changes.

Methods

UpdateFont

public void UpdateFont()

Refreshes font metrics from the current palette (call after palette or LabelStyle changes if text layout is stale).

CreateToolStripRenderer

public ToolStripRenderer? CreateToolStripRenderer()

Creates a tool strip renderer consistent with the label palette.

GetResolvedPalette

Returns the palette instance used for drawing.

Hidden WinForms properties

BackColor, ForeColor, Font, BorderStyle, and FlatStyle are hidden; use palette states and LabelStyle instead.

Usage example

kryptonWrapLabel1.Text = "Long description text that wraps within the control width.";
kryptonWrapLabel1.LabelStyle = LabelStyle.NormalPanel;
kryptonWrapLabel1.AutoSize = false;
kryptonWrapLabel1.Width = 240;
kryptonWrapLabel1.Target = kryptonButton1;

Best practices

  • Set AutoSize = false and a fixed width when you need predictable wrapping in layouts.
  • Use KryptonLabel for single-line labels without wrap semantics.

See also

  • KryptonLabel
  • KryptonLinkWrapLabel
  • Controls index
Back to top Krypton Component Suite BSD 3-Clause License © Component Factory Pty Ltd, 2006 - 2016, All rights reserved. Modifications by Peter Wagner (aka Wagnerp), Simon Coghlan (aka Smurf-IV), Giduac, Ahmed Abdelhameed, tobitege, KamaniAR, Lesandro Gotardo (aka lesandrog), Jorge A. Avilés (aka mcpbcs) et al. 2017 - 2025. All rights reserved. https://github.com/Krypton-Suite