HypernovaDesktop Components · docs
Binarymission
WinForms › Spinner

Spinner

.NET Framework 4.8.NET 6 / 8 / 10v3.0.0WinForms

A domain up-down box – a list of text items the user steps through with the spin buttons or the arrow keys – with a flat, single-line border and spin buttons in colours you choose.

2public types
32public members
1namespaces

Assembly

AssemblyBinarymission.WinForms.Controls.SpinnerControls.dll
Root namespaceBinarymission.WinForms.Controls.InputControls
Target frameworks.NET Framework 4.8, .NET 6 / 8 / 10

Overview

What it is for

A drop-in replacement for DomainUpDown, for a short, ordered set of choices such as a shipping method, a priority or a size, where a drop-down list would be heavier than the choice deserves. Everything the standard control does – Items, wrapping, sorting, typing to select, keyboard and accessibility – works unchanged. What it adds is the look: a flat border that lights up in BorderColor, and spin buttons drawn in three states – resting, hot (under the pointer or holding the focus) and pressed.

Appearance

The button colours follow the Windows colour scheme until they are set. The spin buttons widen with the font, so a large font or a high display scale keeps them in proportion to the text.

Getting started

A shipping-method picker that cannot be typed into, and shows the delivery estimate for the choice.

using System.Drawing;
using System.Windows.Forms;
using Binarymission.WinForms.Controls.InputControls;

var estimate = new Label { Location = new Point(190, 19), AutoSize = true };

var shipping = new BinaryDomainUpDown
{
    Location = new Point(16, 16),
    Width = 160,
    ReadOnly = true,
    Wrap = true,
    BorderColor = Color.SeaGreen,
    UpDownButtonOnFocusBackColor = Color.Honeydew,
    UpDownArrowsColor = Color.DarkGreen
};

shipping.Items.AddRange(new object[] { "Standard", "Express", "Next working day" });
shipping.SelectedIndex = 0;
shipping.SelectedItemChanged += (sender, e) =>
    estimate.Text = shipping.SelectedIndex == 0 ? "3-5 days" : shipping.SelectedIndex == 1 ? "2 days" : "Tomorrow";

checkoutForm.Controls.Add(shipping);
checkoutForm.Controls.Add(estimate);

API reference

Binarymission.WinForms.Controls.InputControls

class BinaryDomainUpDownA domain up-down box - a list of text items the user steps through with the spin buttons or the arrow keys - with a flat, single-line border and spin buttons in colours you choose.
class BinaryNumericUpDownA numeric up-down box with a flat, single-line border and spin buttons in colours you choose - for quantities, prices, percentages and any other number the user types or steps through.