Loading...
Loading...
Guide for implementing Syncfusion StatusBarAdv control in Windows Forms applications. Use when creating application status displays, bottom panels, or status information panels with StatusBarAdvPanel items. Covers installation, panel configuration, appearance styling, gradients, borders, themes, alignment, and event handling for enhanced status bar displays.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-status-barSyncfusion.Windows.Forms.Toolsusing Syncfusion.Windows.Forms.Tools;
using System.Drawing;
using System.Windows.Forms;
public partial class MainForm : Form
{
private StatusBarAdv statusBarAdv1;
private StatusBarAdvPanel culturePanel;
private StatusBarAdvPanel datePanel;
private StatusBarAdvPanel timePanel;
public MainForm()
{
InitializeComponent();
SetupStatusBar();
}
private void SetupStatusBar()
{
// Create StatusBarAdv
statusBarAdv1 = new StatusBarAdv
{
Dock = DockStyle.Bottom,
BackColor = Color.LightSteelBlue,
BorderColor = Color.DarkSlateGray,
BorderStyle = BorderStyle.FixedSingle,
SizingGrip = true
};
// Create panels
culturePanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.CurrentCulture,
Size = new Size(120, 27)
};
datePanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.ShortDate,
Size = new Size(100, 27)
};
timePanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.ShortTime,
Size = new Size(100, 27)
};
// Add panels to StatusBarAdv
statusBarAdv1.Controls.Add(culturePanel);
statusBarAdv1.Controls.Add(datePanel);
statusBarAdv1.Controls.Add(timePanel);
// Add to form
this.Controls.Add(statusBarAdv1);
}
}Imports Syncfusion.Windows.Forms.Tools
Imports System.Drawing
Imports System.Windows.Forms
Public Partial Class MainForm
Inherits Form
Private statusBarAdv1 As StatusBarAdv
Private culturePanel As StatusBarAdvPanel
Private datePanel As StatusBarAdvPanel
Private timePanel As StatusBarAdvPanel
Public Sub New()
InitializeComponent()
SetupStatusBar()
End Sub
Private Sub SetupStatusBar()
' Create StatusBarAdv
statusBarAdv1 = New StatusBarAdv With {
.Dock = DockStyle.Bottom,
.BackColor = Color.LightSteelBlue,
.BorderColor = Color.DarkSlateGray,
.BorderStyle = BorderStyle.FixedSingle,
.SizingGrip = True
}
' Create panels
culturePanel = New StatusBarAdvPanel With {
.PanelType = StatusBarAdvPanelType.CurrentCulture,
.Size = New Size(120, 27)
}
datePanel = New StatusBarAdvPanel With {
.PanelType = StatusBarAdvPanelType.ShortDate,
.Size = New Size(100, 27)
}
timePanel = New StatusBarAdvPanel With {
.PanelType = StatusBarAdvPanelType.ShortTime,
.Size = New Size(100, 27)
}
' Add panels to StatusBarAdv
statusBarAdv1.Controls.Add(culturePanel)
statusBarAdv1.Controls.Add(datePanel)
statusBarAdv1.Controls.Add(timePanel)
' Add to form
Me.Controls.Add(statusBarAdv1)
End Sub
End Classusing Syncfusion.Drawing;
// Set gradient background
statusBarAdv1.BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.AliceBlue,
Color.LightSteelBlue
);
// Apply Metro style
statusBarAdv1.Style = StatusbarStyle.Metro;
// Set metro accent color
statusBarAdv1.MetroColor = ColorTranslator.FromHtml("#16a5dc");
statusBarAdv1.UseMetroColorAsBorder = true;// Enable custom alignment
statusBarAdv1.Alignment = FlowAlignment.ChildConstraints;
// Left-align first panel
statusBarAdv1.SetHAlign(panel1, HorzFlowAlign.Left);
// Right-align second panel
statusBarAdv1.SetHAlign(panel2, HorzFlowAlign.Right);
// Justify third panel to fill space
statusBarAdv1.SetHAlign(panel3, HorzFlowAlign.Justify);// Apply Office2016 Colorful theme
statusBarAdv1.Style = StatusbarStyle.Office2016Colorful;
// Enable auto-sizing
statusBarAdv1.AutoSize = true;
statusBarAdv1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
// Auto-adjust panel heights
statusBarAdv1.AutoHeightControls = true;| Property | Type | Description |
|---|---|---|
| BrushInfo | Background gradient, pattern, or solid color configuration |
| BorderStyle | Border type: None, FixedSingle, or Fixed3D |
| Border3DStyle | 3D border style (10 options: Raised, Sunken, etc.) |
| Color | 2D border color (requires BorderStyle.FixedSingle) |
| ButtonBorderStyle | 2D border style: Solid, Dashed, Dotted, etc. |
| Border3DSide | Border sides to display: Left, Top, Right, Bottom, All |
| StatusbarStyle | Theme: Default, Metro, Office2016Colorful, Office2016White, Office2016Black, Office2016DarkGray |
| Collection | StatusBarAdvPanel controls in the StatusBarAdv |
| FlowAlignment | Panel alignment: Center, Near, Far, ChildConstraints |
| Size | Space between panels |
| Rectangle | Custom rectangle for panel layout |
| bool | Display sizing grip for resizable forms |
| bool | Automatically resize to fit contents |
| AutoSizeMode | Resize mode: GrowAndShrink or GrowOnly |
| bool | Auto-adjust panel heights to StatusBarAdv height |
| Color | Metro theme accent color |
| bool | Use MetroColor as border color |
| bool | Enable themed background drawing |
| bool | Ignore theme background and use BackColor instead |
| Property | Type | Description |
|---|---|---|
| StatusBarAdvPanelType | Panel content type: CurrentCulture, ShortDate, ShortTime, etc. |
| Size | Panel dimensions |
| string | Custom text to display in panel |
| HorzFlowAlign | Horizontal alignment: Left, Center, Right, Justify |