Add TrackBar control with renderer and demo panel#119
Merged
jpobst merged 4 commits intoApr 6, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new TrackBar (slider) control to Modern.Forms, including rendering/layout logic and a ControlGallery demo panel to showcase usage (orientation, ticks, snapping, input methods).
Changes:
- Introduces
TrackBarcontrol with keyboard/mouse/wheel interaction, snapping, and tick configuration. - Adds
TrackBarRendererand registers it inRenderManager. - Adds
TickStyleenum and a ControlGalleryTrackBarPanel, plus a navigation entry in the galleryMainForm.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Modern.Forms/TrackBar.cs | New TrackBar control implementation (range/value, input handling, snapping). |
| src/Modern.Forms/TickStyle.cs | New enum for tick-mark placement options used by TrackBar/renderer. |
| src/Modern.Forms/Renderers/TrackBarRenderer.cs | New renderer for drawing the track/thumb/ticks and doing value↔position mapping. |
| src/Modern.Forms/Renderers/RenderManager.cs | Registers the TrackBar renderer so the control can paint. |
| samples/ControlGallery/Panels/TrackBarPanel.cs | Adds a demo panel showing multiple TrackBar configurations and interactive options. |
| samples/ControlGallery/MainForm.cs | Adds TrackBar to the gallery tree and panel switch logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Collaborator
|
The only issue I found is: the mouse wheel and PageUp/PageDown do not work reliably when using I think if the trackbar is using |
Collaborator
|
Great work! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added TrackBar control with renderer and demo panel.
Supports mouse, keyboard and wheel input.
Includes tick marks and vertical orientation.