HypernovaDesktop Components · docs
Binarymission
WinForms › Extended Text

Extended Text

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

A TextBox with a flat, coloured border that can light up under the pointer, be drawn dotted, and blink to draw the eye to a field that needs attention.

3public types
44public members
1namespaces

Assembly

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

Overview

What it is for

Use it in place of a TextBox on forms where the classic sunken 3-D edge looks out of place, or where a field should call for attention – a required field left empty, or a value that failed validation. All the editing, selection, clipboard and scrolling behaviour is the standard text box's; only the frame round it is drawn by the control.

The border

Blinking

StartToBlink() flashes the border between a colour of your choice and BorderColor until StopBlinking is called – a quiet way to point at the field a validation message is about.

Getting started

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

public class NewCustomerForm : Form
{
    private readonly BinaryExtendedText emailBox;

    public NewCustomerForm()
    {
        Text = "New customer";
        ClientSize = new Size(340, 110);

        emailBox = new BinaryExtendedText
        {
            Location = new Point(12, 12),
            Width = 316,
            BorderColor = Color.SteelBlue,
            BorderColorWhenControlIsNotInFocus = Color.Silver,
            ShowBorderAlways = false          // grey at rest, blue under the pointer or with the focus
        };
        emailBox.TextChanged += (sender, e) => emailBox.StopBlinking();

        var saveButton = new Button { Text = "Save", Location = new Point(253, 70) };
        saveButton.Click += SaveButton_Click;

        Controls.Add(emailBox);
        Controls.Add(saveButton);
    }

    private void SaveButton_Click(object sender, EventArgs e)
    {
        if (!emailBox.Text.Contains("@"))
        {
            emailBox.StartToBlink(Color.Crimson, 400);   // flash until the user edits the field
            emailBox.Focus();
            return;
        }

        Close();
    }
}

API reference

Binarymission.WinForms.Controls.TextControls

class BinaryExtendedTextA TextBox with a flat, coloured border that can light up under the pointer, be drawn dotted, and blink to draw the eye to a field that needs attention.
class BinaryNumericExtendedTextA BinaryExtendedText for numbers - quantities, prices, percentages - that accepts only numeric input, can hold the value within a range, steps it with the arrow keys and the mouse wheel, and reads it back as a decimal.
enum BorderStateThe two ways a BinaryExtendedText can draw its border line.