Loading...
Loading...
Guide for implementing Syncfusion StatusBarAdvPanel control in Windows Forms applications. Use when creating custom status bar panels with marquee text animation, key state indicators, date time displays, or culture information panels. Covers panel types, appearance styling, gradients, marquee animation, alignment, borders, themes, and event handling for enhanced status bar panel displays.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-statusbaradv-panelSyncfusion.Windows.Forms.Toolsusing Syncfusion.Windows.Forms.Tools;
using Syncfusion.Drawing;
using System.Drawing;
using System.Windows.Forms;
public partial class MainForm : Form
{
private StatusBarAdvPanel statusBarAdvPanel1;
public MainForm()
{
InitializeComponent();
SetupStatusBarPanel();
}
private void SetupStatusBarPanel()
{
// Create StatusBarAdvPanel
statusBarAdvPanel1 = new StatusBarAdvPanel
{
// Set panel location and size
Location = new Point(160, 184),
Size = new Size(216, 48),
// Configure panel type to show long date
PanelType = StatusBarAdvPanelType.LongDate,
// Apply gradient background
BackgroundColor = new BrushInfo(
GradientStyle.BackwardDiagonal,
Color.PaleVioletRed,
Color.PeachPuff
),
// Set border and alignment
BorderColor = Color.Black,
HAlign = HorzFlowAlign.Left
};
// Add to form
this.Controls.Add(statusBarAdvPanel1);
}
}Imports Syncfusion.Windows.Forms.Tools
Imports Syncfusion.Drawing
Imports System.Drawing
Imports System.Windows.Forms
Public Partial Class MainForm
Inherits Form
Private statusBarAdvPanel1 As StatusBarAdvPanel
Public Sub New()
InitializeComponent()
SetupStatusBarPanel()
End Sub
Private Sub SetupStatusBarPanel()
' Create StatusBarAdvPanel
statusBarAdvPanel1 = New StatusBarAdvPanel With {
.Location = New Point(160, 184),
.Size = New Size(216, 48),
.PanelType = StatusBarAdvPanelType.LongDate,
.BackgroundColor = New BrushInfo(
GradientStyle.BackwardDiagonal,
Color.PaleVioletRed,
Color.PeachPuff
),
.BorderColor = Color.Black,
.HAlign = HorzFlowAlign.Left
}
' Add to form
Me.Controls.Add(statusBarAdvPanel1)
End Sub
End Class// Configure marquee panel
var marqueePanel = new StatusBarAdvPanel
{
Text = "Welcome to our application! Latest updates available...",
IsMarquee = true,
AnimationStyle = MarqueeStyle.Scroll,
AnimationDirection = MarqueeDirection.Left,
AnimationSpeed = 5,
AnimationDelay = 10,
Size = new Size(300, 30),
BackColor = Color.LightBlue
};
// Start animation on form load
marqueePanel.StartAnimation();
// Stop animation when needed
// marqueePanel.StopAnimation();// NumLock indicator
var numLockPanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.NumLockState,
Size = new Size(80, 24),
HAlign = HorzFlowAlign.Right,
BackgroundColor = new BrushInfo(Color.WhiteSmoke)
};
// CapsLock indicator
var capsLockPanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.CapsLockState,
Size = new Size(80, 24),
HAlign = HorzFlowAlign.Right,
BackgroundColor = new BrushInfo(Color.WhiteSmoke)
};
// InsertKey indicator
var insertKeyPanel = new StatusBarAdvPanel
{
PanelType = StatusBarAdvPanelType.InsertKeyState,
Size = new Size(80, 24),
HAlign = HorzFlowAlign.Right,
BackgroundColor = new BrushInfo(Color.WhiteSmoke)
};// Create panel with 3D raised border
var borderedPanel = new StatusBarAdvPanel
{
Text = "Status: Ready",
Size = new Size(150, 30),
BorderStyle = BorderStyle.Fixed3D,
Border3DStyle = Border3DStyle.RaisedInner,
BorderSides = Border3DSide.All,
Alignment = HorizontalAlignment.Center,
BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.LavenderBlush,
Color.RosyBrown
)
};| Property | Type | Description |
|---|---|---|
| PanelType | StatusBarAdvPanelType | Type of panel (Custom, NumLockState, CapsLockState, ScrollLockState, InsertKeyState, ShortDate, LongDate, ShortTime, LongTime, CurrentCulture) |
| Text | string | Text displayed in the panel (for Custom panel type) |
| BackgroundColor | BrushInfo | Background gradient, pattern, or solid color |
| Icon | Icon | Icon displayed in the panel |
| Alignment | HorizontalAlignment | Alignment of text and icon (Left, Right, Center) |
| HAlign | HorzFlowAlign | Horizontal alignment in flow layout (Left, Right, Center, Justify) |
| IsMarquee | bool | Enables marquee-style text animation |
| AnimationStyle | MarqueeStyle | Animation style (Scroll, Slide, Alternate) |
| AnimationDirection | MarqueeDirection | Animation direction (Left, Right) |
| AnimationSpeed | int | Speed of marquee animation |
| AnimationDelay | int | Delay before animation starts |
| BorderStyle | BorderStyle | Border style (None, FixedSingle, Fixed3D) |
| Border3DStyle | Border3DStyle | 3D border style (10 options) |
| BorderColor | Color | Color of 2D border |
| BorderSingle | ButtonBorderStyle | 2D border style (Solid, Dashed, Dotted, etc.) |
| BorderSides | Border3DSide | Border sides to display (All, Top, Bottom, Left, Right, Middle) |
| SizeToContent | bool | Auto-resize panel based on content |
| PreferredSize | Size | Preferred size in flow layout |
| ThemesEnabled | bool | Enables themed appearance |
| IgnoreThemeBackground | bool | Ignores theme background color |
| ToolTip | string | Tooltip text for the panel |