HypernovaDesktop Components · docs
Binarymission
WinForms › Button Suite

Button Suite

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

A check box that draws its own box, tick and text, in colours you choose – a crisp, flat check box that looks the same on every version of Windows and at every display scale.

2public types
24public members
1namespaces

Assembly

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

Overview

It is a CheckBox in every other way: CheckBox.Checked, CheckBox.CheckState, CheckBox.ThreeState, the CheckBox.CheckedChanged event, the keyboard and the accessibility all work as usual. Only the picture changes.

Colours

A disabled check box is drawn with a grey box on the system control colour and grey text.

Size and layout

The box grows with the font (to about four fifths of the font's height, and never below 11 logical pixels), and stays sharp at any display scale because it is drawn, not copied from an image. CheckBox.CheckAlign, TextAlign, Control.Padding and Control.RightToLeft place the box and the text as on a standard check box.

An indeterminate check box (Indeterminate) is drawn with the same tick as a checked one.

Getting started

Two options on an export dialog, in the application's brand colours.

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

public class ExportOptionsForm : Form
{
    private readonly ExtendedCheckBox _includeInvoices = new ExtendedCheckBox();
    private readonly ExtendedCheckBox _zipFiles = new ExtendedCheckBox();

    public ExportOptionsForm()
    {
        Text = "Export orders";

        _includeInvoices.Text = "Include invoices (PDF)";
        _includeInvoices.Location = new Point(16, 16);
        _includeInvoices.AutoSize = true;
        _includeInvoices.Checked = true;
        _includeInvoices.NormalControlColor = Color.FromArgb(0, 84, 147);
        _includeInvoices.OnFocusControlColor = Color.FromArgb(0, 120, 212);
        _includeInvoices.ControlBackColor = Color.AliceBlue;

        _zipFiles.Text = "Compress into a single .zip file";
        _zipFiles.Location = new Point(16, 44);
        _zipFiles.AutoSize = true;
        _zipFiles.NormalControlColor = Color.FromArgb(0, 84, 147);
        _zipFiles.OnFocusControlColor = Color.FromArgb(0, 120, 212);
        _zipFiles.CheckedChanged += (sender, e) => Console.WriteLine("Zip: " + _zipFiles.Checked);

        Controls.Add(_includeInvoices);
        Controls.Add(_zipFiles);
    }
}

API reference

Binarymission.WinForms.Controls.ButtonControls

class ExtendedCheckBoxA check box that draws its own box, tick and text, in colours you choose - a crisp, flat check box that looks the same on every version of Windows and at every display scale.
class ExtendedRadioButtonA radio button that draws its own circle, dot and text, in colours you choose - a crisp, flat radio button that looks the same on every version of Windows and at every display scale.