Progress Indicator
A simple, circular progress display around the button that indicates playback or loading progress.
Overview
Feature Details
Property
Type
Default Value
Description
Code Examples
Basic Integration
using System;
using System.Drawing;
using System.Windows.Forms;
using SiticoneNetFrameworkUI;
namespace ProgressIndicatorDemo
{
public partial class MainForm : Form
{
private SiticonePlayPauseButton playPauseButton;
public MainForm()
{
InitializeComponent();
InitializeCustomComponents();
}
private void InitializeCustomComponents()
{
playPauseButton = new SiticonePlayPauseButton
{
Location = new Point(50, 50),
Size = new Size(80, 80),
// Enable the progress indicator
ShowProgress = true,
// Set initial progress to 0%
PlayProgress = 0.0f,
// Customize the progress color (semi-transparent green)
ProgressColor = Color.FromArgb(128, 0, 255, 0)
};
// Optionally, subscribe to state change events
playPauseButton.StateChanged += PlayPauseButton_StateChanged;
// Add the control to the form
this.Controls.Add(playPauseButton);
// Simulate progress update
Timer progressTimer = new Timer
{
Interval = 100
};
progressTimer.Tick += ProgressTimer_Tick;
progressTimer.Start();
}
private void ProgressTimer_Tick(object sender, EventArgs e)
{
// Update progress value gradually from 0.0 to 1.0
if (playPauseButton.PlayProgress < 1.0f)
{
playPauseButton.PlayProgress += 0.01f;
}
else
{
// Reset progress to simulate continuous loading
playPauseButton.PlayProgress = 0.0f;
}
}
private void PlayPauseButton_StateChanged(object sender, EventArgs e)
{
// Handle state changes if needed
Console.WriteLine("Play/Pause state changed.");
}
}
}Advanced Customization
Key Points
Aspect
Details
Best Practices
Recommendation
Rationale
Common Pitfalls
Issue
Explanation
Prevention
Usage Scenarios
Scenario
Description
Sample Code Reference
Review
Checklist Item
Status/Recommendation
Summary
Additional Sections
Integration Tips
Tip
Explanation
Demo Projects
Demo Feature
Description
Last updated