HypernovaDesktop Components · docs
Binarymission
WinForms › Super Tooltip

Super Tooltip

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

An Office-style "super tool tip": a tool tip with a title, a body of several lines with an optional picture, a footer, icons, and a gradient or solid background – one component that gives a rich tip to any number of controls on a form.

10public types
88public members
1namespaces

Assembly

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

Overview

Use it where a one-line tool tip is not enough to explain a command: what it does, what it affects, a preview, and where to find more help. Drop one component on a form, and every control on the form gains a set of "on superToolTip1" properties in the Properties window; in code, call the SetBinarySuperToolTip... methods with the control and the value.

The parts of a tip

The tip is sized to fit these each time it opens, up to half the screen's working area each way, unless it is given a fixed size (SetBinarySuperToolTipUseCustomSizing, SetBinarySuperToolTipCustomSize).

Colours

Either choose one of the built-in ColorScheme values – a gradient from the scheme's colour to the window colour, with text and borders in the window text colour – or set the background (SetBinarySuperToolTipBackgroundDrawingStyle and its colours), the text colours and fonts, and the border yourself. To use a built-in scheme, set the background style to DrawingStyle.Gradient first.

Timing and custom drawing

When and for how long tips show is the standard ToolTip behaviour: ToolTip.InitialDelay, ToolTip.AutoPopDelay and the rest work as usual. AboutToPopup lets you cancel a tip as it opens, and HeaderDraw, BodyDraw and FooterDraw let you draw any region yourself.

Getting started

A rich tip for a "Send invoice" button, in the built-in blue scheme.

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

public class InvoiceForm : Form
{
    private readonly BinarySuperToolTip _tips = new BinarySuperToolTip();
    private readonly Button _send = new Button { Text = "Send", Location = new Point(16, 16) };

    public InvoiceForm()
    {
        Controls.Add(_send);

        _tips.InitialDelay = 600;
        _tips.AutoPopDelay = 15000;

        _tips.SetBinarySuperToolTipBackgroundDrawingStyle(_send, DrawingStyle.Gradient);
        _tips.SetBinarySuperToolTipBuiltInColorScheme(_send, ColorScheme.Blue);

        _tips.SetBinarySuperToolTipTitleText(_send, "Send invoice");
        _tips.SetBinarySuperToolTipTitleTextFont(_send, new Font("Segoe UI", 10f, FontStyle.Bold));
        _tips.SetBinarySuperToolTipTitleIcon(_send, SystemIcons.Information);
        _tips.SetBinarySuperToolTipDrawTitleIcon(_send, true);

        _tips.SetBinarySuperToolTipBodyText(_send,
            "Emails this invoice as a PDF to the customer's billing contact." + Environment.NewLine +
            "The invoice is then marked as sent and can no longer be edited.");

        _tips.SetBinarySuperToolTipFooterText(_send, "Press F1 for more help");
        _tips.SetBinarySuperToolTipFooterIcon(_send, SystemIcons.Question);
        _tips.SetBinarySuperToolTipDrawFooterIcon(_send, true);
        _tips.SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea(_send, true);
    }
}

API reference

Binarymission.WinForms.Controls.Popups

delegate AboutToPopupHandlerRepresents the method that handles AboutToPopup, raised before a tool tip opens.
class BinarySuperToolTipAn Office-style "super tool tip": a tool tip with a title, a body of several lines with an optional picture, a footer, icons, and a gradient or solid background - one component that gives a rich tip to any number of controls on a form.
class BinarySuperToolTipDrawingEventArgsProvides data for HeaderDraw, BodyDraw and FooterDraw: the surface and rectangle to draw a region of a tip in, and a way to say it has been drawn.
class BinarySuperToolTipPopupEventArgsProvides data for AboutToPopup: which control's tip is opening, and a way to stop it.
class BinarySuperToolTipPropertiesEditorThe design-time dialog that edits a super tool tip's content and appearance. The designer opens it from the property grid; it is not meant to be shown at run time.
delegate BodyDrawingHandlerRepresents the method that handles BodyDraw, raised before the tool tip's body is drawn.
enum ColorSchemeSpecifies a built-in colour scheme for a BinarySuperToolTip tip.
enum DrawingStyleSpecifies how the background of a BinarySuperToolTip tip is filled.
delegate FooterDrawingHandlerRepresents the method that handles FooterDraw, raised before the tool tip's footer is drawn.
delegate HeaderDrawingHandlerRepresents the method that handles HeaderDraw, raised before the tool tip's title area is drawn.