Animation & Interaction Effects
This feature provides dynamic animations and interactive feedback to enhance the user experience by smoothly transitioning values, animating the thumb on hover and selection, and providing feedback.
Overview
Property Reference Table
Property
Type
Description
Default Value
Category
Code Integration Example
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;
public class AnimationDemoForm : Form
{
private SiticoneHTrackBar trackBar;
private Button toggleHoverEffectsButton;
private Button changeThumbAnimationButton;
private bool hoverEnabled = true;
private int thumbTypeIndex = 0;
private ThumbType[] thumbTypes = new ThumbType[] {
ThumbType.Solid,
ThumbType.Blink,
ThumbType.Gradient,
ThumbType.Pulsate,
ThumbType.Glow
};
public AnimationDemoForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
// Instantiate the track bar with animation properties
trackBar = new SiticoneHTrackBar
{
Location = new Point(20, 20),
Size = new Size(300, 40),
Minimum = 0,
Maximum = 100,
Value = 50,
HoverAnimationInterval = 15, // Smooth hover transitions
ValueAnimationInterval = 1, // Fast value transitions
ShakeAnimationInterval = 50, // Quick shake effect on invalid input
HoverEffects = true,
ThumbType = ThumbType.Blink, // Initial thumb animation mode
CanBeep = true, // Enable beep on invalid input
CanShake = true // Enable shake on invalid input
};
// Button to toggle hover effects
toggleHoverEffectsButton = new Button
{
Location = new Point(20, 80),
Size = new Size(140, 30),
Text = "Toggle Hover Effects"
};
toggleHoverEffectsButton.Click += (s, e) =>
{
trackBar.HoverEffects = !trackBar.HoverEffects;
MessageBox.Show("HoverEffects set to: " + trackBar.HoverEffects);
};
// Button to cycle through different thumb animation modes
changeThumbAnimationButton = new Button
{
Location = new Point(180, 80),
Size = new Size(140, 30),
Text = "Change Thumb Animation"
};
changeThumbAnimationButton.Click += (s, e) =>
{
thumbTypeIndex = (thumbTypeIndex + 1) % thumbTypes.Length;
trackBar.ThumbType = thumbTypes[thumbTypeIndex];
MessageBox.Show("ThumbType set to: " + trackBar.ThumbType);
};
// Add controls to the form
Controls.Add(trackBar);
Controls.Add(toggleHoverEffectsButton);
Controls.Add(changeThumbAnimationButton);
// Form settings
Text = "Animation & Interaction Effects Demo";
ClientSize = new Size(360, 140);
}
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new AnimationDemoForm());
}
}Key Points
Key Aspect
Explanation
Best Practices
Best Practice
Recommendation
Common Pitfalls
Pitfall
How to Avoid
Usage Scenarios
Scenario
Description
Real Life Usage Scenarios
Real Life Scenario
Application
Troubleshooting Tips
Issue
Troubleshooting Step
Review
Review Aspect
Summary
Summary
Additional Resources
Resource
Description
Last updated