mcpField
S
syncfusion-winforms-trackbar

syncfusion-winforms-trackbar

github.com/syncfusionDesign & UI280 installsUpdated 1w ago
Repository

About syncfusion-winforms-trackbar

A guide to using Syncfusion TrackBarEx in Windows Forms applications. It explains slider value ranges, orientation, appearance options, and interaction events.

Key features

  1. 01Configurable value range
  2. 02Horizontal and vertical layouts
  3. 03Optional increment buttons
  4. 04Slider and channel styling
  5. 05Scroll event handling

Use cases

  1. 01Adjust numeric settings with a slider
  2. 02Set a volume level
  3. 03Choose a value within thresholds
  4. 04Handle changes to slider values

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/winforms-ui-components-skills --skill syncfusion-winforms-trackbar

After installing, type/syncfusion-winforms-trackbarin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
appearance-customization.md
getting-started.md
orientation-events.md
value-management.md

Details

From the project README

Implementing TrackBarEx in Windows Forms

TrackBarEx is an advanced Windows Forms control that provides an interactive slider for value selection. It allows users to drag a slider or click buttons to set values within a specified range, ideal for scenarios requiring intuitive value input.

When to Use This Skill

Use this skill when you need to:

  • Create an interactive slider control for value selection
  • Allow users to input values by dragging a slider or clicking increment/decrement buttons
  • Customize appearance (buttons, colors, gradient)
  • Set horizontal or vertical orientation
  • Configure value ranges with minimum and maximum
  • Handle scroll events when users change values
  • Manage small and large change increments
  • Support both designer and programmatic control creation

Component Overview

TrackBarEx combines a slider, track channel, and optional increment/decrement buttons to provide intuitive value selection. Users can interact with the control using mouse drag, button clicks, or keyboard navigation.

Key Capabilities:

  • Slider and button customization (size, color, appearance)
  • Value management with configurable ranges
  • Horizontal and vertical orientation
  • Appearance options (gradient, transparency, focus rectangle)
  • Scroll event handling for value changes
  • Increment/decrement button control
  • Channel and track customization

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Assembly dependencies and project setup
  • Adding control via designer
  • Adding control programmatically
  • Setting basic minimum and maximum values
  • Understanding default configurations
Appearance and Customization

📄 Read: references/appearance-customization.md

  • Button appearance properties (ShowButton, ButtonColor, HighlightedButtonColor, PushedButtonEndColor)
  • Slider and channel settings (sizes, dimensions)
  • Gradient colors (TrackBarGradientStart, TrackBarGradientEnd)
  • Focus rectangle and transparency options
  • Complete appearance customization patterns
Value Management and Configuration

📄 Read: references/value-management.md

  • Minimum, Maximum, and Value properties
  • SmallChange vs LargeChange increments
  • SmallIncrease, SmallDecrease, LargeIncrease, LargeDecrease methods
  • Timer intervals for button hold behavior
  • Managing value ranges and constraints
Orientation and Events

📄 Read: references/orientation-events.md

  • Horizontal and vertical orientation modes
  • Scroll event handling
  • Responding to user interactions
  • Common event scenarios and patterns
  • Best practices for event handling

Quick Start Example

Create a basic TrackBarEx control with customized appearance and value handling:

using Syncfusion.Windows.Forms.Tools;
using System.Windows.Forms;

public class Form1 : Form
{
    private TrackBarEx trackBarEx1;

    public Form1()
    {
        // Create and configure control
        trackBarEx1 = new TrackBarEx();
        trackBarEx1.Minimum = 0;
        trackBarEx1.Maximum = 100;
        trackBarEx1.Value = 50;
        trackBarEx1.ShowButtons = true;
        trackBarEx1.ButtonColor = System.Drawing.Color.DodgerBlue;
        trackBarEx1.Orientation = Orientation.Horizontal;
        
        // Add scroll event handler
        trackBarEx1.Scroll += TrackBarEx1_Scroll;
        
        // Add to form
        this.Controls.Add(trackBarEx1);
    }

    private void TrackBarEx1_Scroll(object sender, EventArgs e)
    {
        // Update UI or application state when value changes
        System.Diagnostics.Debug.WriteLine($"Value: {trackBarEx1.Value}");
    }
}

Common Patterns

Setting Up Value Ranges

Define appropriate minimum and maximum values for your use case:

trackBarEx1.Minimum = 10;
trackBarEx1.Maximum = 100;
trackBarEx1.Value = 50;
Customizing Button Appearance

Enhance visual feedback with button color customization:

trackBarEx1.ShowButtons = true;
trackBarEx1.ButtonColor = System.Drawing.Color.LightBlue;
trackBarEx1.HighlightedButtonColor = System.Drawing.Color.Blue;
trackBarEx1.PushedButtonEndColor = System.Drawing.Color.DarkBlue;
Handling Value Changes

Respond to user interactions with the Scroll event:

trackBarEx1.Scroll += (s, e) => {
    // Handle value change
};
Changing Orientation

Switch between horizontal and vertical layouts:

// For vertical layout
trackBarEx1.Orientation = Orientation.Vertical;

// For horizontal layout
trackBarEx1.Orientation = Orientation.Horizontal;

Key Properties

PropertyPurpose
ValueGets or sets the current slider position
MinimumGets or sets the minimum value (default: 10)
MaximumGets or sets the maximum value (default: 20)
OrientationSets horizontal or vertical layout
ShowButtonsToggles visibility of increment/decrement buttons
SmallChangeValue change for arrow key or small increment (default: 1)
LargeChangeValue change for large increment (default: 5)
ButtonColorColor of increment/decrement buttons
HighlightedButtonColorButton color when highlighted
PushedButtonEndColorButton color when pressed
TransparentEnables transparent background

Common Use Cases

  • Volume Control: Use TrackBarEx for audio volume adjustment with visual feedback
  • Slider Input: Replace text input with intuitive slider for numeric value selection
  • Progress Indication: Display adjustable progress or completion percentage
  • Range Selection: Allow users to set minimum and maximum thresholds
  • Parameter Tuning: Enable easy adjustment of application settings or thresholds

Comments

Markdown supported