Siticone Form
The SiticoneForm is a comprehensive replacement for the standard Windows Form. It creates a modern, borderless window experience with built-in animations, an enhanced control box, and a sophisticated styling engine.
Standard WinForms often suffer from flickering resizing, rigid title bars, and outdated aesthetics. SiticoneForm solves this by implementing a custom title bar system, hardware-accelerated drop shadows, and automatic fade-in/fade-out transitions, all while remaining fully compatible with the Visual Studio Designer.
Key Features
Features activated immediately upon inheritance or property configuration.
| Feature | Description |
|---|---|
Borderless Shadow |
Automatically renders a professional, native-feeling drop shadow behind the form without requiring standard Windows borders. This supports both Light and Dark themes natively. |
Enhanced Control Box |
Beyond standard Minimize/Maximize/Close, this form includes optional Help, Settings, and Pin-to-Top buttons directly in the title bar. |
Animations |
Built-in logic for smooth Fade In on load and Fade Out on close. Includes interactive animations like the Close button icon rotation on hover. |
Smart Behaviors |
Includes safety features like Close Countdown timers (to prevent accidental closing) and optional Close Confirmation dialogs. |
Getting Started
To use SiticoneForm, simply change your form to inherit from this class instead of the standard Form. The form will automatically adopt the borderless style and shadow.
using SiticoneNetFrameworkUI;
// Switch inheritance from 'Form' to 'SiticoneForm'
public partial class MainApplication : SiticoneForm
{
public MainApplication()
{
InitializeComponent();
// The form now supports borderless dragging, shadows, and animations.
this.Text = "My Modern App";
this.StartPosition = FormStartPosition.CenterScreen;
// Optional: Enable the "Pin to Top" button in the header
this.ShowPinToTopBox = true;
}
}
Visual Customization
The form exposes extensive properties to style the Title Bar and Control Box buttons (Close, Maximize, Minimize, etc.) for every state (Normal, Hover, Pressed).
public ApplyDarkTheme()
{
// 1. Base Form Colors
this.BackColor = Color.FromArgb(30, 30, 30);
// 2. Title Bar Styling
this.TitleBarBackColor = Color.FromArgb(40, 40, 40);
this.TitleBarForeColor = Color.White;
this.FormTitleFont = new Font("Segoe UI", 10f, FontStyle.Bold);
// 3. Customize Control Box Buttons (e.g., Close Button)
this.CloseButtonBackColor = Color.Transparent;
this.CloseButtonForeColor = Color.White;
// Set distinct colors for hover state
this.CloseButtonHoverBackColor = Color.Red;
this.CloseButtonHoverForeColor = Color.White;
// 4. Enable visual flair
this.RotateCloseIconOnHover = true;
}
Advanced Behaviors
SiticoneForm includes built-in logic for scenarios often required in kiosk or critical applications.
Safe Closing (Countdown)
Prevents accidental closure by enforcing a countdown on the close button.
public SetupSafeClose()
{
// When the user clicks 'X', it starts a timer instead of closing immediately.
this.EnableCloseCountdown = true;
// Set countdown to 3 seconds
this.CloseCountdownDuration = 3;
// Customize the font used for the countdown number overlay
this.CloseCountdownFont = new Font("Arial", 12f, FontStyle.Bold);
}
Pin to Top
Allows the user to keep the window floating above all others using a built-in button.
// 1. Show the Pin button in the title bar
this.ShowPinToTopBox = true;
// 2. Customize the color of the icon when it is actively pinned
this.PinToTopPinnedIconColor = Color.DodgerBlue;
// 3. Handle the event (optional, logic is handled internally but you might want to save state)
this.PinToTopClicked += (s, e) =>
{
Console.WriteLine($"Form Pinned State: {this.IsPinned}");
// Save 'this.IsPinned' to user settings...
};
API Reference
Appearance & Title Bar
| Property | Type | Description |
|---|---|---|
FormTitle |
string | Sets the text displayed in the custom title bar. Maps to the standard Text property. |
TitleBarBackColor |
Color | Background color of the title bar area. |
TitleBarHeight |
int | Height of the title bar in pixels. Default is 36. |
ForceDropshadow |
bool | If true, the form renders a shadow even when not focused. |
ThemeVariant |
Enum | Quickly applies a preset color scheme (Light/Dark variants). |
Control Box Visibility
| Property | Type | Description |
|---|---|---|
ShowCloseBox |
bool | Toggles visibility of the Close (X) button. |
ShowMaximizeBox |
bool | Toggles visibility of the Maximize/Restore button. |
ShowMinimizeBox |
bool | Toggles visibility of the Minimize button. |
ShowPinToTopBox |
bool | Toggles visibility of the Pin button (sets TopMost). |
ShowSettingsBox |
bool | Toggles visibility of the Settings (Gear) button. Fires SettingsClicked. |
ShowHelpBox |
bool | Toggles visibility of the Help (?) button. Fires HelpButtonClicked. |
Window Behavior
| Property | Type | Description |
|---|---|---|
DragTitleBar |
bool | If true, the user can move the window by clicking and holding the title bar. |
DragEntireForm |
bool | If true, the user can move the window by clicking anywhere on the form background. |
EnableCloseCountdown |
bool | Enables the 3-2-1 countdown logic on the close button. |
EnableCloseConfirmation |
bool | If true, shows a Yes/No MessageBox before allowing the form to close. |
PreventFormClosing |
bool | If true, disables the closing mechanism entirely (useful for critical processes). |
Events
// Fired when the settings (gear) icon is clicked
this.SettingsClicked += (s, e) => OpenSettingsMenu();
// Fired when the help (?) icon is clicked
this.HelpButtonClicked += (s, e) => ShowHelpDocs();
// Fired when the pin state toggles
this.IsPinnedChanged += (s, e) =>
{
// e is IsPinnedChangedEventArgs
Debug.WriteLine("Pinned: " + e.IsPinned);
};
// Fired when user toggles maximize/restore
this.MaximizeStateChanged += (s, e) => AdjustLayout();