Siticone Logo
Siticone UI
DOCS
v2025.12.15
Docs Drag Form

Siticone Drag Form Control

The SiticoneDragForm is a high-performance, styleable panel that enables dragging functionality for borderless forms. It replaces the standard Windows title bar, offering advanced features like animated gradients, icon support, double-click maximization logic, and system theme monitoring. It serves as the primary header control for creating modern, custom-styled application windows.

Core Configuration

Fundamental settings to link the control to a form and enable dragging.

Property Type Description & Usage Example
TargetForm Form dragForm.TargetForm = this; The parent form that will be moved when this control is dragged. If null, it automatically finds the parent.
EnableDragging bool dragForm.EnableDragging = true; Toggles the ability to move the form. Useful for locking the window in place.
EnableDoubleClickMaximize bool dragForm.EnableDoubleClickMaximize = true; Allows double-clicking the panel to toggle between Maximized and Normal window states.
MaximizeToWorkingArea bool dragForm.MaximizeToWorkingArea = true; If true, maximizing respects the taskbar area. Essential for borderless forms.

Appearance & Styling

Customize the header's look with gradients, titles, and icons.

Property Type Description & Usage Example
Title string dragForm.Title = "My Application"; The text displayed in the header.
Icon Image dragForm.Icon = Properties.Resources.AppLogo; An optional icon image displayed next to the title.
EnableGradient bool dragForm.EnableGradient = true; Renders a gradient background instead of a solid color.
GradientStartColor Color dragForm.GradientStartColor = Color.FromArgb(97, 0, 255); The starting color of the background gradient.
GradientEndColor Color dragForm.GradientEndColor = Color.FromArgb(137, 76, 255); The ending color of the background gradient.
TitleAlign ContentAlignment dragForm.TitleAlign = ContentAlignment.MiddleLeft; Determines the position of the title text (Left, Center, Right).

Visual Effects

Add polish with animations, shadows, and text effects.

Property Type Description & Usage Example
AnimateGradient bool dragForm.AnimateGradient = true; Continuously shifts the gradient colors for a dynamic, living background.
EnableGlowOnHover bool dragForm.EnableGlowOnHover = true; Adds a subtle lighting effect when the mouse moves over the header.
EnableTextShadow bool dragForm.EnableTextShadow = true; Adds a drop shadow to the title text for better readability against complex backgrounds.
EnableShadow bool dragForm.EnableShadow = true; Renders a shadow beneath the header control itself.

Theme Management

Built-in support for operating system theme changes (Light/Dark mode).

Property Type Description & Usage Example
IsSystemThemeMonitoringEnabled bool dragForm.IsSystemThemeMonitoringEnabled = true; If true, the control listens for Windows theme change events and triggers ThemeChanged.

Events

Event Handling
// 1. Drag Started
// Fires when the user begins moving the form. Useful for changing opacity.
dragForm.DragStarted += (s, e) => 
{
                this.Opacity = 0.85;
};

// 2. Drag Ended
// Fires when the user releases the mouse. Restore opacity here.
dragForm.DragEnded += (s, e) => 
{
                this.Opacity = 1.0;
};

// 3. Theme Changed
// Fires when the OS theme changes (Light/Dark).
dragForm.ThemeChanged += (s, e) => 
{
                if (e.NewTheme == ThemeMode.Dark)
        dragForm.ApplyDarkTheme();
                else
        dragForm.ApplyLightTheme();
};

Designer Experience

The control includes Smart Tags for rapid configuration in Visual Studio.

Category Features
Themes Apply predefined styles instantly: Light, Dark, Primary, Sunset, Midnight.
Layout Actions Dock Top: Automatically docks the control to the top of the form to act as a title bar.

Detailed Usage Examples

Example 1: Custom Title Bar

Replacing the standard Windows title bar with a custom blue gradient header.

C# - Title Bar Setup
private void InitializeTitleBar()
{
                var titleBar = new SiticoneDragForm();
    titleBar.Dock = DockStyle.Top;
    titleBar.Height = 40;
    titleBar.TargetForm = this;
    
                // Content
    titleBar.Title = "My Modern App";
    titleBar.Icon = Properties.Resources.AppIcon;
    titleBar.TitleAlign = ContentAlignment.MiddleLeft;
    titleBar.IconPadding = 10;
    
                // Visuals (Ocean Blue)
    titleBar.EnableGradient = true;
    titleBar.GradientStartColor = Color.FromArgb(0, 122, 204);
    titleBar.GradientEndColor = Color.FromArgb(0, 90, 150);
    
                this.Controls.Add(titleBar);
}

Example 2: Animated Header with Transparency

A dynamic header that animates its gradient and handles drag transparency.

C# - Animated Header
private void SetupAnimatedHeader(SiticoneDragForm header)
{
    header.AnimateGradient = true;
    header.AnimationSpeed = 1.5f;
    header.EnableGlowOnHover = true;
    header.GlowColor = Color.White;
    
                // Drag Opacity Logic
    header.DragStarted += (s, e) => this.Opacity = 0.9;
    header.DragEnded += (s, e) => this.Opacity = 1.0;
}