Siticone Check Button
The SiticoneCheckButton is a toggleable control that acts like a button but maintains a checked or unchecked state.
Unlike a standard checkbox, it looks and behaves like a button, offering rich gradient backgrounds, smooth state transitions, and interactive feedback (shakes and beeps) for read-only scenarios.
State & Behavior
Manage the core toggle functionality and interaction modes.
| Property | Type | Description |
|---|---|---|
IsChecked |
bool | Gets or sets the state of the button. Changing this triggers animations unless UltraFastPerformance is enabled. |
IsReadonly |
bool |
When true, the button cannot be toggled by the user. Clicking it triggers the CanShake or CanBeep feedback if enabled.
|
CanShake |
bool | Enables a "No" shake animation when a user clicks a read-only button. |
CanBeep |
bool | Plays a system sound when a user clicks a read-only button. |
Visual Styling
The control supports dual-color gradients for every state (Checked, Unchecked, Hover, Pressed).
| Property | Type | Description |
|---|---|---|
CheckedBackColor1/2 |
Color | Gradient colors when the button is in the ON state. |
UncheckedBackColor1/2 |
Color | Gradient colors when the button is in the OFF state. |
HoverBackColor1/2 |
Color | Gradient colors displayed when the mouse is over the button (only applies if unchecked). |
PressedBackColor1/2 |
Color | Gradient colors displayed while the button is being clicked. |
GradientMode |
Enum | Direction of the gradient (Vertical, Horizontal, Diagonal). |
Borders & Corners
Customize the shape and outline of the button.
| Property | Type | Description |
|---|---|---|
CornerRadius... |
int | Individual properties for TopLeft, TopRight, BottomLeft, and BottomRight radii to create unique shapes (e.g., leaves, pills). |
BorderWidth |
int | Thickness of the border (Minimum 2px). |
CheckedBorderColor |
Color | Border color when IsChecked is true. |
UncheckedBorderColor |
Color | Border color when IsChecked is false. |
Events
Advanced events for controlling interaction flow.
// Allows you to cancel the state change before it happens.
checkBtn.CheckedChanging += (s, e) =>
{
if (e.NewValue == true && !IsAuthorized())
{
e.Cancel = true; // Prevent the button from checking
MessageBox.Show("Authorization required.");
}
};
// Fired after the state has successfully updated.
checkBtn.CheckedChanged += (s, e) =>
{
// e.IsChecked contains the new state
// e.ChangeReason tells you if it was user-click or code
Console.WriteLine($"State changed to {e.IsChecked} by {e.ChangeReason}");
};
// Fired when a user clicks a ReadOnly button.
checkBtn.ReadonlyAccessAttempted += (s, e) =>
{
// e.AttemptMethod: "MouseClick" or "Keyboard"
lblStatus.Text = "This setting is currently locked.";
};
Designer Support
The control includes a comprehensive Smart Tag menu in Visual Studio for rapid configuration.
| Category | Features |
|---|---|
Themes |
Apply one-click presets like Light, Dark, Primary, Success, Error, Material, etc. |
Quick Shape |
Helpers to make the button Pill-shaped or Square instantly. |
Colors |
Direct access to all gradient start/end colors for all states. |
Usage Examples
Example 1: Simple Toggle Button
A standard toggle for a setting like "Enable Notifications".
private void SetupNotificationToggle()
{
btnNotify.Text = "Notifications";
btnNotify.ApplyPrimaryTheme(); // Use built-in Blue theme
btnNotify.CheckedChanged += (s, e) =>
{
if (e.IsChecked) EnableNotifications();
else DisableNotifications();
};
}
Example 2: Locked Feature (ReadOnly)
Using the ReadOnly state to show a feature that is available but currently disabled or locked.
private void SetupPremiumFeature()
{
btnPremium.Text = "Premium Mode";
btnPremium.IsReadonly = true;
btnPremium.CanShake = true; // Shake on click
// Customize ReadOnly look to be distinct
btnPremium.ReadonlyBackColor1 = Color.LightGray;
btnPremium.ReadonlyBackColor2 = Color.Silver;
btnPremium.ReadonlyForeColor = Color.DarkGray;
}
Example 3: Custom Gradient Theme
Creating a unique visual style with custom gradients.
private void ApplySunsetTheme()
{
// Checked State: Orange/Red Gradient
btnTheme.CheckedBackColor1 = Color.Orange;
btnTheme.CheckedBackColor2 = Color.OrangeRed;
btnTheme.CheckedForeColor = Color.White;
// Unchecked State: Pale Yellow
btnTheme.UncheckedBackColor1 = Color.LightYellow;
btnTheme.UncheckedBackColor2 = Color.LemonChiffon;
btnTheme.UncheckedForeColor = Color.DarkOrange;
btnTheme.GradientMode = LinearGradientMode.ForwardDiagonal;
btnTheme.CornerRadius = 20; // Round edges
}
Example 4: Ultra-Fast Mode
For applications with many controls where performance is critical, disable animations.
private void OptimizeForGrid()
{
// When using many buttons in a list/grid
foreach (var btn in buttonList)
{
btn.UltraFastPerformance = true; // Disables fade animations
btn.CanShake = false;
}
}