Events
This feature provides a comprehensive set of events to notify applications of immediate, dynamic, and final value changes for responsive integration.
Overview
Event Reference Table
Event Name
Delegate Type
Description
Triggered When
Code Integration Example
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;
public class EventsDemoForm : Form
{
private SiticoneHTrackBar trackBar;
private Label eventLogLabel;
public EventsDemoForm()
{
InitializeComponent();
SubscribeToEvents();
}
private void InitializeComponent()
{
// Instantiate the trackbar control
trackBar = new SiticoneHTrackBar
{
Location = new Point(20, 20),
Size = new Size(300, 40),
Minimum = 0,
Maximum = 100,
Value = 50,
Step = 5
};
// Label to display event notifications
eventLogLabel = new Label
{
Location = new Point(20, 80),
Size = new Size(300, 100),
Font = new Font("Segoe UI", 10),
AutoSize = false,
BorderStyle = BorderStyle.FixedSingle
};
// Add controls to the form
Controls.Add(trackBar);
Controls.Add(eventLogLabel);
// Form settings
Text = "Events Demo";
ClientSize = new Size(360, 200);
}
private void SubscribeToEvents()
{
// Subscribe to ValueChanged event
trackBar.ValueChanged += (s, e) =>
{
LogEvent("ValueChanged: " + trackBar.Value);
};
// Subscribe to ValueHasChanged event
trackBar.ValueHasChanged += (s, newValue) =>
{
LogEvent("ValueHasChanged: " + newValue);
};
// Subscribe to ValueChangedComplete event
trackBar.ValueChangedComplete += (s, finalValue) =>
{
LogEvent("ValueChangedComplete: " + finalValue);
};
// Subscribe to DynamicValueUpdated event
trackBar.DynamicValueUpdated += (s, args) =>
{
LogEvent("DynamicValueUpdated: " + args.Value);
};
}
private void LogEvent(string message)
{
// Append the event message to the label
eventLogLabel.Text += message + Environment.NewLine;
}
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new EventsDemoForm());
}
}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