syncfusion-winforms-splash-panel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Windows Forms Splash Panel (SplashPanel)

Windows Forms 闪屏面板(SplashPanel)

The Syncfusion Windows Forms SplashPanel control enables creation of custom splash screens that display during application startup or as non-obtrusive notification windows. It supports animations, child controls, timed auto-close, and flexible positioning.
Syncfusion Windows Forms SplashPanel控件支持创建自定义闪屏,可在应用启动期间展示,或作为无侵扰的通知窗口使用。它支持动画效果、子控件、定时自动关闭和灵活的位置配置。

When to Use This Skill

何时使用该技能

Use this skill when you need to:
  • Display splash screens during application startup or loading
  • Show progress information or branding during initialization
  • Create notification popups similar to MSN Messenger or email notifications
  • Implement loading indicators with custom content and animations
  • Show timed messages that auto-close after a specified duration
  • Display modal dialogs with custom splash content
  • Add animated transitions (slide, fade, marquee) to splash windows
  • Position splash windows at specific desktop locations (center, corners, system tray area, custom)
  • Include child controls (buttons, labels, images) in splash screens
  • Handle splash lifecycle events (before display, displayed, closing, closed)
当你需要实现以下需求时可使用该技能:
  • 应用启动或加载期间展示闪屏
  • 初始化过程中展示进度信息或品牌标识
  • 创建类似MSN Messenger、邮件通知的通知弹窗
  • 实现带自定义内容和动画的加载指示器
  • 展示指定时长后自动关闭的定时消息
  • 展示带自定义闪屏内容的模态对话框
  • 为闪屏窗口添加动画过渡效果(滑动、淡入淡出、跑马灯)
  • 将闪屏窗口定位到桌面特定位置(居中、角落、系统托盘区域、自定义位置)
  • 在闪屏中加入子控件(按钮、标签、图片)
  • 处理闪屏生命周期事件(展示前、已展示、关闭中、已关闭)

Component Overview

组件概述

Key Features:
  • Animation styles: Slide (horizontal/vertical/directional), Fade, Marquee
  • Desktop alignment: Center, SystemTray, corners (LeftTop, LeftBottom, RightTop, RightBottom), Custom
  • Display methods: ShowSplash (modeless), ShowDialogSplash (modal), HideSplash
  • Auto-close timer: Configurable interval or manual control (-1 for no auto-close)
  • Child controls: Add any Windows Forms controls to the splash panel
  • Appearance: Gradient backgrounds, images, borders, transparency
  • Behavior: AllowMove, AllowResize, CloseOnClick options
  • Events: BeforeSplash, SplashDisplayed, SplashClosing, SplashClosed, mouse events
核心特性:
  • 动画样式: 滑动(水平/垂直/定向)、淡入淡出、跑马灯
  • 桌面对齐: 居中、系统托盘、角落(左上、左下、右上、右下)、自定义
  • 展示方法: ShowSplash(非模态)、ShowDialogSplash(模态)、HideSplash
  • 自动关闭计时器: 可配置间隔或手动控制(-1表示不自动关闭)
  • 子控件: 可向闪屏面板添加任意Windows Forms控件
  • 外观: 渐变背景、图片、边框、透明度
  • 行为: 允许拖动、允许调整大小、点击关闭选项
  • 事件: BeforeSplash、SplashDisplayed、SplashClosing、SplashClosed、鼠标事件

Documentation and Navigation Guide

文档与导航指南

Getting Started

入门指南

📄 Read: references/getting-started.md
Read this reference when you need to:
  • Install SplashPanel via NuGet or configure in designer
  • Add SplashPanel to a Windows Forms project
  • Create a SplashPanel instance programmatically
  • Add child controls to the splash panel
  • Call ShowSplash() method for basic display
  • Understand assembly requirements and deployment
📄 阅读: references/getting-started.md
当你需要实现以下需求时阅读该参考文档:
  • 通过NuGet安装SplashPanel或在设计器中配置
  • 向Windows Forms项目中添加SplashPanel
  • 以编程方式创建SplashPanel实例
  • 向闪屏面板添加子控件
  • 调用ShowSplash()方法实现基础展示
  • 了解程序集要求和部署相关事项

Display Methods

展示方法

📄 Read: references/display-methods.md
Read this reference when you need to:
  • Show splash panel with ShowSplash() method and parameters
  • Hide splash panel with HideSplash() method
  • Display as modal dialog with ShowDialogSplash()
  • Check if splash is currently showing with IsShowing()
  • Configure TimerInterval for auto-close duration
  • Set splash location and owner form
  • Display splash in taskbar with custom icon/text
📄 阅读: references/display-methods.md
当你需要实现以下需求时阅读该参考文档:
  • 使用ShowSplash()方法及参数展示闪屏面板
  • 使用HideSplash()方法隐藏闪屏面板
  • 使用ShowDialogSplash()展示为模态对话框
  • 使用IsShowing()检查闪屏当前是否正在展示
  • 配置TimerInterval设置自动关闭时长
  • 设置闪屏位置和所有者窗体
  • 在任务栏展示带自定义图标/文本的闪屏

Animation and Appearance

动画与外观

📄 Read: references/animation-appearance.md
Read this reference when you need to:
  • Enable and configure animation speed
  • Set SlideStyle (Horizontal, Vertical, FadeIn, etc.)
  • Show splash as topmost window
  • Customize background with gradients or images
  • Configure border styles and transparency
  • Set desktop alignment (Center, SystemTray, corners)
  • Enable behavior options (AllowMove, AllowResize, CloseOnClick)
  • Suspend auto-close when mouse is over splash
📄 阅读: references/animation-appearance.md
当你需要实现以下需求时阅读该参考文档:
  • 启用并配置动画速度
  • 设置SlideStyle(水平、垂直、淡入等)
  • 将闪屏展示为置顶窗口
  • 自定义渐变或图片背景
  • 配置边框样式和透明度
  • 设置桌面对齐方式(居中、系统托盘、角落)
  • 启用行为选项(允许拖动、允许调整大小、点击关闭)
  • 鼠标悬停在闪屏上时暂停自动关闭

Slide Transitions

滑动过渡效果

📄 Read: references/slide-transitions.md
Read this reference when you need to:
  • Configure AnimationDirection (Default, LeftToRight, RightToLeft)
  • Implement marquee transitions that traverse the screen
  • Set MarqueeDirection (LeftToRight, RightToLeft, TopToBottom, BottomToTop)
  • Combine slide transitions with desktop alignment
  • Create advanced animation effects
📄 阅读: references/slide-transitions.md
当你需要实现以下需求时阅读该参考文档:
  • 配置AnimationDirection(默认、从左到右、从右到左)
  • 实现横贯屏幕的跑马灯过渡效果
  • 设置MarqueeDirection(从左到右、从右到左、从上到下、从下到上)
  • 结合滑动过渡与桌面对齐配置
  • 创建高级动画效果

Events

事件

📄 Read: references/events.md
Read this reference when you need to:
  • Handle BeforeSplash event (cancel splash display)
  • Respond to SplashDisplayed event
  • Handle SplashClosing event (cancel closing)
  • Respond to SplashClosed event (get close type)
  • Handle mouse enter/leave events on splash
  • Implement custom logic during splash lifecycle
📄 阅读: references/events.md
当你需要实现以下需求时阅读该参考文档:
  • 处理BeforeSplash事件(可取消闪屏展示)
  • 响应SplashDisplayed事件
  • 处理SplashClosing事件(可取消关闭)
  • 响应SplashClosed事件(获取关闭类型)
  • 处理闪屏的鼠标进入/离开事件
  • 在闪屏生命周期中实现自定义逻辑

Quick Start

快速开始

Basic Splash Screen

基础闪屏

csharp
using Syncfusion.Windows.Forms.Tools;

// Create splash panel
SplashPanel splashPanel = new SplashPanel();
splashPanel.Size = new Size(400, 300);
splashPanel.DesktopAlignment = SplashAlignment.Center;
splashPanel.TimerInterval = 3000; // Show for 3 seconds
splashPanel.ShowAnimation = true;
splashPanel.SlideStyle = SlideStyle.FadeIn;

// Add to form
this.Controls.Add(splashPanel);

// Show splash
splashPanel.ShowSplash();
VB.NET:
vb
Imports Syncfusion.Windows.Forms.Tools

' Create splash panel
Dim splashPanel As New SplashPanel()
splashPanel.Size = New Size(400, 300)
splashPanel.DesktopAlignment = SplashAlignment.Center
splashPanel.TimerInterval = 3000 ' Show for 3 seconds
splashPanel.ShowAnimation = True
splashPanel.SlideStyle = SlideStyle.FadeIn

' Add to form
Me.Controls.Add(splashPanel)

' Show splash
splashPanel.ShowSplash()
csharp
using Syncfusion.Windows.Forms.Tools;

// Create splash panel
SplashPanel splashPanel = new SplashPanel();
splashPanel.Size = new Size(400, 300);
splashPanel.DesktopAlignment = SplashAlignment.Center;
splashPanel.TimerInterval = 3000; // Show for 3 seconds
splashPanel.ShowAnimation = true;
splashPanel.SlideStyle = SlideStyle.FadeIn;

// Add to form
this.Controls.Add(splashPanel);

// Show splash
splashPanel.ShowSplash();
VB.NET:
vb
Imports Syncfusion.Windows.Forms.Tools

' Create splash panel
Dim splashPanel As New SplashPanel()
splashPanel.Size = New Size(400, 300)
splashPanel.DesktopAlignment = SplashAlignment.Center
splashPanel.TimerInterval = 3000 ' Show for 3 seconds
splashPanel.ShowAnimation = True
splashPanel.SlideStyle = SlideStyle.FadeIn

' Add to form
Me.Controls.Add(splashPanel)

' Show splash
splashPanel.ShowSplash()

Common Patterns

常用模式

Pattern 1: Startup Splash with Branding

模式1:带品牌标识的启动闪屏

csharp
// Application startup splash
SplashPanel startupSplash = new SplashPanel();
startupSplash.Size = new Size(500, 350);
startupSplash.BackgroundImage = Image.FromFile("splash_image.png");
startupSplash.DesktopAlignment = SplashAlignment.Center;
startupSplash.TimerInterval = 5000;
startupSplash.ShowAnimation = true;
startupSplash.AnimationSpeed = 20;

// Add label with version info
Label versionLabel = new Label();
versionLabel.Text = "Version 2.0";
versionLabel.Location = new Point(20, 300);
versionLabel.AutoSize = true;
startupSplash.Controls.Add(versionLabel);

this.Controls.Add(startupSplash);
startupSplash.ShowSplash();
csharp
// Application startup splash
SplashPanel startupSplash = new SplashPanel();
startupSplash.Size = new Size(500, 350);
startupSplash.BackgroundImage = Image.FromFile("splash_image.png");
startupSplash.DesktopAlignment = SplashAlignment.Center;
startupSplash.TimerInterval = 5000;
startupSplash.ShowAnimation = true;
startupSplash.AnimationSpeed = 20;

// Add label with version info
Label versionLabel = new Label();
versionLabel.Text = "Version 2.0";
versionLabel.Location = new Point(20, 300);
versionLabel.AutoSize = true;
startupSplash.Controls.Add(versionLabel);

this.Controls.Add(startupSplash);
startupSplash.ShowSplash();

Pattern 2: Notification-Style Popup

模式2:通知类弹窗

csharp
// Non-obtrusive notification (like MSN Messenger)
SplashPanel notificationPanel = new SplashPanel();
notificationPanel.Size = new Size(300, 100);
notificationPanel.DesktopAlignment = SplashAlignment.RightBottom;
notificationPanel.SlideStyle = SlideStyle.BottomToTop;
notificationPanel.AnimationDirection = AnimationDirection.Default;
notificationPanel.TimerInterval = 5000;
notificationPanel.ShowAnimation = true;
notificationPanel.CloseOnClick = true;
notificationPanel.SuspendAutoCloseWhenMouseOver = true;

// Add notification content
Label messageLabel = new Label();
messageLabel.Text = "New message received!";
messageLabel.Location = new Point(10, 40);
notificationPanel.Controls.Add(messageLabel);

this.Controls.Add(notificationPanel);
notificationPanel.ShowSplash();
csharp
// Non-obtrusive notification (like MSN Messenger)
SplashPanel notificationPanel = new SplashPanel();
notificationPanel.Size = new Size(300, 100);
notificationPanel.DesktopAlignment = SplashAlignment.RightBottom;
notificationPanel.SlideStyle = SlideStyle.BottomToTop;
notificationPanel.AnimationDirection = AnimationDirection.Default;
notificationPanel.TimerInterval = 5000;
notificationPanel.ShowAnimation = true;
notificationPanel.CloseOnClick = true;
notificationPanel.SuspendAutoCloseWhenMouseOver = true;

// Add notification content
Label messageLabel = new Label();
messageLabel.Text = "New message received!";
messageLabel.Location = new Point(10, 40);
notificationPanel.Controls.Add(messageLabel);

this.Controls.Add(notificationPanel);
notificationPanel.ShowSplash();

Pattern 3: Modal Loading Dialog

模式3:模态加载对话框

csharp
// Modal splash dialog that blocks interaction
SplashPanel modalSplash = new SplashPanel();
modalSplash.Size = new Size(400, 200);
modalSplash.TimerInterval = -1; // No auto-close
modalSplash.DesktopAlignment = SplashAlignment.Center;

// Add progress indicator
Label loadingLabel = new Label();
loadingLabel.Text = "Loading, please wait...";
loadingLabel.Location = new Point(120, 90);
loadingLabel.AutoSize = true;
modalSplash.Controls.Add(loadingLabel);

this.Controls.Add(modalSplash);

// Show as modal dialog (blocks until closed)
modalSplash.ShowDialogSplash(this);
csharp
// Modal splash dialog that blocks interaction
SplashPanel modalSplash = new SplashPanel();
modalSplash.Size = new Size(400, 200);
modalSplash.TimerInterval = -1; // No auto-close
modalSplash.DesktopAlignment = SplashAlignment.Center;

// Add progress indicator
Label loadingLabel = new Label();
loadingLabel.Text = "Loading, please wait...";
loadingLabel.Location = new Point(120, 90);
loadingLabel.AutoSize = true;
modalSplash.Controls.Add(loadingLabel);

this.Controls.Add(modalSplash);

// Show as modal dialog (blocks until closed)
modalSplash.ShowDialogSplash(this);

Pattern 4: Animated Splash with Gradient

模式4:带渐变背景的动画闪屏

csharp
// Splash with gradient background and animation
SplashPanel animatedSplash = new SplashPanel();
animatedSplash.Size = new Size(450, 300);
animatedSplash.BackgroundColor = new BrushInfo(
    GradientStyle.Vertical, 
    Color.DarkBlue, 
    Color.LightBlue);
animatedSplash.DesktopAlignment = SplashAlignment.Center;
animatedSplash.SlideStyle = SlideStyle.Horizontal;
animatedSplash.ShowAnimation = true;
animatedSplash.AnimationSpeed = 30;
animatedSplash.TimerInterval = 4000;
animatedSplash.ShowAsTopMost = true;

this.Controls.Add(animatedSplash);
animatedSplash.ShowSplash();
csharp
// Splash with gradient background and animation
SplashPanel animatedSplash = new SplashPanel();
animatedSplash.Size = new Size(450, 300);
animatedSplash.BackgroundColor = new BrushInfo(
    GradientStyle.Vertical, 
    Color.DarkBlue, 
    Color.LightBlue);
animatedSplash.DesktopAlignment = SplashAlignment.Center;
animatedSplash.SlideStyle = SlideStyle.Horizontal;
animatedSplash.ShowAnimation = true;
animatedSplash.AnimationSpeed = 30;
animatedSplash.TimerInterval = 4000;
animatedSplash.ShowAsTopMost = true;

this.Controls.Add(animatedSplash);
animatedSplash.ShowSplash();

Pattern 5: Custom Positioned Splash

模式5:自定义位置的闪屏

csharp
// Splash at custom screen location
SplashPanel customSplash = new SplashPanel();
customSplash.Size = new Size(350, 250);
customSplash.DesktopAlignment = SplashAlignment.Custom;
customSplash.TimerInterval = 3000;

// Show at mouse position
Point mousePos = Control.MousePosition;
customSplash.ShowSplash(mousePos, this, false);
csharp
// Splash at custom screen location
SplashPanel customSplash = new SplashPanel();
customSplash.Size = new Size(350, 250);
customSplash.DesktopAlignment = SplashAlignment.Custom;
customSplash.TimerInterval = 3000;

// Show at mouse position
Point mousePos = Control.MousePosition;
customSplash.ShowSplash(mousePos, this, false);

Pattern 6: Splash with Lifecycle Events

模式6:带生命周期事件的闪屏

csharp
// Splash with event handlers
SplashPanel eventSplash = new SplashPanel();
eventSplash.Size = new Size(400, 250);
eventSplash.DesktopAlignment = SplashAlignment.Center;
eventSplash.TimerInterval = 5000;

// Subscribe to events
eventSplash.BeforeSplash += (s, e) => {
    Console.WriteLine("About to show splash");
};

eventSplash.SplashDisplayed += (s, e) => {
    Console.WriteLine("Splash is now visible");
};

eventSplash.SplashClosing += (s, e) => {
    Console.WriteLine("Splash is closing");
    // e.Cancel = true; // Uncomment to prevent closing
};

eventSplash.SplashClosed += (s, e) => {
    Console.WriteLine($"Splash closed: {e.SplashCloseType}");
};

this.Controls.Add(eventSplash);
eventSplash.ShowSplash();
csharp
// Splash with event handlers
SplashPanel eventSplash = new SplashPanel();
eventSplash.Size = new Size(400, 250);
eventSplash.DesktopAlignment = SplashAlignment.Center;
eventSplash.TimerInterval = 5000;

// Subscribe to events
eventSplash.BeforeSplash += (s, e) => {
    Console.WriteLine("About to show splash");
};

eventSplash.SplashDisplayed += (s, e) => {
    Console.WriteLine("Splash is now visible");
};

eventSplash.SplashClosing += (s, e) => {
    Console.WriteLine("Splash is closing");
    // e.Cancel = true; // Uncomment to prevent closing
};

eventSplash.SplashClosed += (s, e) => {
    Console.WriteLine($"Splash closed: {e.SplashCloseType}");
};

this.Controls.Add(eventSplash);
eventSplash.ShowSplash();

Key Properties

核心属性

PropertyTypeDescription
TimerInterval
intDuration in milliseconds to display splash (-1 for no auto-close)
DesktopAlignment
SplashAlignmentPosition on desktop (Center, SystemTray, corners, Custom)
SlideStyle
SlideStyleAnimation style (Horizontal, Vertical, FadeIn, etc.)
AnimationSpeed
intSpeed of animation transition (higher = faster)
ShowAnimation
boolEnable/disable animation on display
ShowAsTopMost
boolDisplay splash as topmost window
BackgroundColor
BrushInfoGradient or solid background color
BackgroundImage
ImageBackground image for splash
AllowMove
boolAllow user to move splash at runtime
AllowResize
boolAllow user to resize splash at runtime
CloseOnClick
boolClose splash when user clicks on it
SuspendAutoCloseWhenMouseOver
boolSuspend auto-close timer when mouse is over splash
AnimationDirection
AnimationDirectionDirection of slide animation
MarqueeDirection
MarqueeDirectionDirection of marquee transition
BorderStyle
Border3DStyle3D border style for splash
TransparentColor
ColorTransparent color for background
ShowInTaskbar
boolDisplay splash in Windows taskbar
属性类型描述
TimerInterval
int闪屏展示时长,单位为毫秒(-1表示不自动关闭)
DesktopAlignment
SplashAlignment桌面展示位置(居中、系统托盘、角落、自定义)
SlideStyle
SlideStyle动画样式(水平、垂直、淡入等)
AnimationSpeed
int动画过渡速度(数值越高速度越快)
ShowAnimation
bool启用/禁用展示动画
ShowAsTopMost
bool将闪屏展示为置顶窗口
BackgroundColor
BrushInfo渐变或纯色背景
BackgroundImage
Image闪屏背景图片
AllowMove
bool允许用户运行时拖动闪屏
AllowResize
bool允许用户运行时调整闪屏大小
CloseOnClick
bool用户点击闪屏时关闭
SuspendAutoCloseWhenMouseOver
bool鼠标悬停在闪屏上时暂停自动关闭计时器
AnimationDirection
AnimationDirection滑动动画方向
MarqueeDirection
MarqueeDirection跑马灯过渡方向
BorderStyle
Border3DStyle闪屏3D边框样式
TransparentColor
Color背景透明色
ShowInTaskbar
bool在Windows任务栏展示闪屏

Key Methods

核心方法

MethodDescription
ShowSplash()
Display the splash panel
ShowSplash(Point, Form, bool)
Display at specific location with owner form
ShowDialogSplash(Form)
Display as modal dialog
ShowDialogSplash(Point, Form)
Display as modal dialog at specific location
HideSplash()
Hide the splash panel
IsShowing()
Check if splash is currently displayed
SuspendAutoCloseMode()
Suspend auto-close timer
RestoreAutoCloseMode()
Restore auto-close timer
方法描述
ShowSplash()
展示闪屏面板
ShowSplash(Point, Form, bool)
在指定位置展示,绑定所有者窗体
ShowDialogSplash(Form)
展示为模态对话框
ShowDialogSplash(Point, Form)
在指定位置展示为模态对话框
HideSplash()
隐藏闪屏面板
IsShowing()
检查闪屏当前是否处于展示状态
SuspendAutoCloseMode()
暂停自动关闭计时器
RestoreAutoCloseMode()
恢复自动关闭计时器

Common Use Cases

常见使用场景

Use Case 1: Application Startup Screen

场景1:应用启动界面

Display branding and version information while the application initializes.
在应用初始化过程中展示品牌标识和版本信息。

Use Case 2: Loading Indicator

场景2:加载指示器

Show a splash panel with progress information during lengthy operations.
在执行耗时操作时展示带进度信息的闪屏面板。

Use Case 3: Notification Popup

场景3:通知弹窗

Display non-obtrusive messages (new mail, updates) that auto-close or close on click.
展示无侵扰消息(新邮件、更新通知),支持自动关闭或点击关闭。

Use Case 4: About/Info Dialog

场景4:关于/信息对话框

Show application information as a modal splash dialog.
以模态闪屏对话框的形式展示应用信息。

Use Case 5: Custom Message Window

场景5:自定义消息窗口

Create themed message windows with custom controls and animations.
创建带自定义控件和动画的主题化消息窗口。

Best Practices

最佳实践

  1. Set appropriate TimerInterval: Use 2000-5000ms for startup splashes, 3000-8000ms for notifications
  2. Enable ShowAsTopMost: Ensure splash appears above other windows during startup
  3. Use CloseOnClick for notifications: Allow users to dismiss notification-style popups
  4. Handle BeforeSplash event: Initialize data or cancel display based on conditions
  5. Choose appropriate animations: FadeIn for subtle, Slide for dynamic, Marquee for attention-grabbing
  6. Add child controls carefully: Ensure controls are visible and properly positioned within splash bounds
  7. Test different alignments: Verify splash appears correctly on different screen resolutions
  8. Dispose properly: Ensure splash panel is properly disposed when form closes
  1. 设置合适的TimerInterval:启动闪屏建议设置2000-5000ms,通知建议设置3000-8000ms
  2. 启用ShowAsTopMost:确保启动过程中闪屏显示在其他窗口上方
  3. 为通知启用CloseOnClick:允许用户手动关闭通知类弹窗
  4. 处理BeforeSplash事件:可根据条件初始化数据或取消闪屏展示
  5. 选择合适的动画:淡入适合低调场景、滑动适合动态场景、跑马灯适合需要吸引注意力的场景
  6. 谨慎添加子控件:确保控件在闪屏边界内可见且位置正确
  7. 测试不同对齐方式:验证闪屏在不同屏幕分辨率下展示正常
  8. 正确释放资源:确保窗体关闭时SplashPanel被正确释放

Related Components

相关组件

  • MessageBoxAdv: For standard message dialogs
  • ProgressBarAdv: For progress indication within splash screens
  • StatusBarAdv: For application status information
  • MessageBoxAdv:用于标准消息对话框
  • ProgressBarAdv:用于在闪屏中展示进度
  • StatusBarAdv:用于展示应用状态信息