Siticone Minimize Button
The SiticoneMinimizeButton is a specialized window control that allows users to minimize the parent form.
It features smooth color transitions, press scaling animations, and specialized read-only behaviors (shaking and beeping) to provide rich user feedback.
Unlike standard buttons, it automatically detects its parent form and handles the window state changes internally.
Appearance & Styling
Properties to customize the look of the button in various states (Normal, Hover, Read-Only).
| Property | Type | Description & Usage Example |
|---|---|---|
IconColor |
Color | minBtn.IconColor = Color.Black; The color of the minimize line in the normal state. |
IconHoverColor |
Color | minBtn.IconHoverColor = Color.DodgerBlue; The color of the minimize line when the mouse is hovering over the control. |
BorderColor |
Color | minBtn.BorderColor = Color.Gray; The color of the outer border. |
BorderHoverColor |
Color | minBtn.BorderHoverColor = Color.Blue; The color of the border when hovering. |
EnableBorder |
bool | minBtn.EnableBorder = true; Toggles the visibility of the border rectangle. |
IconThickness |
int | minBtn.IconThickness = 2; The stroke width of the minimize line. |
IconWidth |
int | minBtn.IconWidth = 14; The length of the horizontal minimize line in pixels. |
IconSize |
int | minBtn.IconSize = 10; Defines the height of the icon's bounding box (icon is centered within this). |
Behavior & Interaction
Controls how the button responds to user input and its operational mode.
| Property | Type | Description & Usage Example |
|---|---|---|
IsReadOnly |
bool | minBtn.IsReadOnly = true; If true, clicking the button does NOT minimize the form. Instead, it triggers the ReadOnly visual feedback (Shake/Beep). |
ReadonlyIconColor |
Color |
minBtn.ReadonlyIconColor = Color.LightGray;
The icon color used when IsReadOnly is true.
|
ReadonlyBorderColor |
Color |
minBtn.ReadonlyBorderColor = Color.Silver;
The border color used when IsReadOnly is true.
|
CanShake |
bool | minBtn.CanShake = true; If true, the entire parent form shakes when the button is clicked in a ReadOnly state. |
CanBeep |
bool | minBtn.CanBeep = true; If true, plays a system beep sound when clicked in a ReadOnly state. |
Animation Properties
Fine-tune the visual transitions for hovering and pressing.
| Property | Type | Description & Usage Example |
|---|---|---|
AnimationSpeed |
int | minBtn.AnimationSpeed = 15; The interval (in ms) for color interpolation timers. Lower values mean faster updates. |
EnablePressAnimation |
bool | minBtn.EnablePressAnimation = true; Enables the shrinking effect when the mouse button is held down. |
PressScaleAmount |
float | minBtn.PressScaleAmount = 0.9f; The scale factor (0.0 to 1.0) the button shrinks to when pressed. |
PressAnimationSpeed |
float | minBtn.PressAnimationSpeed = 0.1f; The interpolation step size for the press animation. Higher values mean snappier animations. |
Events
Hooks to intervene in the minimization process or react to interactions.
// Fired immediately before the parent form's WindowState is changed.
// Use this to cancel the minimization or perform cleanup logic.
minBtn.BeforeMinimize += (sender, e) =>
{
if (preventMinimize)
{
e.Cancel = true;
MessageBox.Show("Minimization is currently disabled.");
}
};
// Fired after the form has successfully minimized.
minBtn.AfterMinimize += (sender, e) =>
{
Console.WriteLine("Form was minimized.");
};
// Fired when the user clicks the button while IsReadOnly = true.
minBtn.ReadonlyInteraction += (sender, e) =>
{
ToolTip.Show("This feature is locked.", minBtn, 0, -20, 2000);
};
Designer Support
The control includes comprehensive design-time support via Smart Tags.
| Feature | Description |
|---|---|
Theme Presets |
Apply visual styles instantly from the Smart Tag menu:
|
Utilities |
Copy Settings: Copies visual properties to the clipboard. Paste Settings: Applies copied settings to another instance. Invert Colors: Swaps normal and hover colors. Reset All: Reverts all properties to defaults. |
Detailed Examples
Example 1: Conditional Minimization
Prevent minimizing if a critical process is running.
public void ConfigureMinimizeButton()
{
minBtn.BeforeMinimize += (s, e) =>
{
if (_isProcessRunning)
{
e.Cancel = true;
MessageBox.Show("Cannot minimize while processing data.");
// Visually indicate error
minBtn.IconColor = Color.Red;
}
};
}
Example 2: Read-Only "Locked" State
Disabling the button with visual feedback instead of hiding it.
public void LockWindow()
{
minBtn.IsReadOnly = true;
minBtn.ReadonlyIconColor = Color.DimGray;
minBtn.ReadonlyBorderColor = Color.LightGray;
// Enable haptic-like feedback
minBtn.CanShake = true;
minBtn.CanBeep = true;
minBtn.ReadonlyInteraction += (s, e) =>
{
statusLabel.Text = "Window is locked by Admin.";
};
}