Skip to content

HeaderTableLayoutPanel

Radu Martin edited this page Apr 14, 2017 · 14 revisions

HeaderTableLayoutPanel is a WinForms control inherited from TableLayoutPanel and provides highlighted header. This control may show the header in a number of different ways:

HeaderTableLayoutPanel

Properties

The HeaderTableLayoutPanel implements three properties.

The CaptionText property contains a text for showing. If this property is string.Empty or null then the header will not be shown:

[Browsable(true), DefaultValue(null), 
 Category("Header"), Description("Header text")]
public string CaptionText { get; set; } 

The CaptionStyle property is enum of HighlightCaptionStyle type. This property points a drawing style (see the image above):

[Browsable(true), DefaultValue(HighlightCaptionStyle.ForeColor), 
 Category("Header"), Description("Drawing header style")]
public HighlightCaptionStyle CaptionStyle { get; set; }

The HighlightCaptionStyle enum can be ForeColor, HighlightColor, ForeStyle, HighlightStyle, NavisionAxaptaStyle, GroupBoxStyle:

public enum HighlightCaptionStyle
{
  ForeColor, HighlightColor, ForeStyle, HighlightStyle, 
  NavisionAxaptaStyle, GroupBoxStyle
}

The CaptionLineWidth is a byte property that points the width of header's line (0 - the line will not be shown):

[Browsable(true), DefaultValue((byte)2), 
 Category("Header"), Description("Width of the header line")]
public byte CaptionLineWidth { get; set; }

Remarks about the CaptionLineWidth property

If CaptionStyle = HighlightCaptionStyle.HighlightStyle, then two lines with Width = CaptionLineWidth will be shown, one will be above the Header and the second one will be below the header. For CaptionStyle = HighlightCaptionStyle.GroupBoxStyle this property does not do anything.