HypernovaDesktop Components · docs
Binarymission
WinForms › Super Tooltip › BinarySuperToolTip

BinarySuperToolTip

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.Popups

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.

public partial class BinarySuperToolTip : System.Windows.Forms.ToolTip, IExtenderProvider

Inherits from / implements: System.Windows.Forms.ToolTip, IExtenderProvider

Remarks

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.

Examples

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);
    }
}

See also

Members at a glance

Constructors
BinarySuperToolTipInitialises a new super tool tip component, with no tips set for any control yet.
Properties
OwnerDrawGets a value that is always true: the component always draws its tips itself.
Methods
GetBinarySuperToolTipBackgroundDrawingGradientEndColorGets the colour a gradient background of control's tool tip ends with.
GetBinarySuperToolTipBackgroundDrawingGradientStartColorGets the colour a gradient background of control's tool tip starts from.
GetBinarySuperToolTipBackgroundDrawingSolidColorGets the background colour of control's tool tip when it is drawn solid.
GetBinarySuperToolTipBackgroundDrawingStyleGets whether the background of control's tool tip is a gradient or a solid colour.
GetBinarySuperToolTipBodyFooterSeparatingLineDepthGets the thickness of the line between the body and the footer of control's tool tip.
GetBinarySuperToolTipBodyImageGets the picture shown at the left of the body of control's tool tip.
GetBinarySuperToolTipBodyImageTransparencyColorGets the colour made see-through in the body picture of control's tool tip.
GetBinarySuperToolTipBodyTextGets the main text of control's tool tip.
GetBinarySuperToolTipBodyTextFontGets the font of the body text in control's tool tip.
GetBinarySuperToolTipBodyTextForeColorGets the colour of the body text in control's tool tip.
GetBinarySuperToolTipBorderColorGets the colour of the border round control's tool tip.
GetBinarySuperToolTipBorderColourAroundImageGets the colour of the frame round the body picture of control's tool tip.
GetBinarySuperToolTipBuiltInColorSchemeGets the built-in colour scheme control's tool tip is drawn in.
GetBinarySuperToolTipCustomSizeGets the fixed size of control's tool tip.
GetBinarySuperToolTipDrawBorderGets whether a border is drawn round control's tool tip.
GetBinarySuperToolTipDrawBorderAroundBodyImageGets whether a frame is drawn round the body picture of control's tool tip.
GetBinarySuperToolTipDrawFooterIconGets whether the footer icon of control's tool tip is shown.
GetBinarySuperToolTipDrawLineSeparatingBodyAndFooterAreaGets whether a line is drawn between the body and the footer of control's tool tip.
GetBinarySuperToolTipDrawTitleIconGets whether the title icon of control's tool tip is shown.
GetBinarySuperToolTipFooterIconGets the icon shown beside the footer text of control's tool tip.
GetBinarySuperToolTipFooterTextGets the text at the foot of control's tool tip.
GetBinarySuperToolTipFooterTextFontGets the font of the footer text in control's tool tip.
GetBinarySuperToolTipFooterTextForeColorGets the colour of the footer text in control's tool tip.
GetBinarySuperToolTipGradientDrawingOrientationAngleGets the direction of the gradient background of control's tool tip.
GetBinarySuperToolTipLineColorOnTopOfFooterAreaGets the colour of the line between the body and the footer of control's tool tip.
GetBinarySuperToolTipTitleIconGets the icon shown beside the title of control's tool tip.
GetBinarySuperToolTipTitleTextGets the heading at the top of control's tool tip.
GetBinarySuperToolTipTitleTextFontGets the font of the title text in control's tool tip.
GetBinarySuperToolTipTitleTextForeColorGets the colour of the title text in control's tool tip.
GetBinarySuperToolTipUseCustomSizingGets whether control's tool tip has a fixed size rather than one fitted to its content.
SetBinarySuperToolTipBackgroundDrawingGradientEndColorSets the colour a gradient background of control's tool tip ends with.
SetBinarySuperToolTipBackgroundDrawingGradientStartColorSets the colour a gradient background of control's tool tip starts from.
SetBinarySuperToolTipBackgroundDrawingSolidColorSets the background colour of control's tool tip when it is drawn solid.
SetBinarySuperToolTipBackgroundDrawingStyleSets whether the background of control's tool tip is a gradient or a solid colour.
SetBinarySuperToolTipBodyFooterSeparatingLineDepthSets the thickness of the line between the body and the footer of control's tool tip.
SetBinarySuperToolTipBodyImageSets a picture to show at the left of the body of control's tool tip, beside the body text – a preview, a chart or a screenshot of what the control does.
SetBinarySuperToolTipBodyImageTransparencyColorSets the colour made see-through in the body picture of control's tool tip, so the tip's background shows through it.
SetBinarySuperToolTipBodyTextSets the main text of control's tool tip, and so turns the tip on for that control.
SetBinarySuperToolTipBodyTextFontSets the font of the body text in control's tool tip.
SetBinarySuperToolTipBodyTextForeColorSets the colour of the body text in control's tool tip.
SetBinarySuperToolTipBorderColorSets the colour of the border round control's tool tip.
SetBinarySuperToolTipBorderColourAroundImageSets the colour of the frame round the body picture of control's tool tip.
SetBinarySuperToolTipBuiltInColorSchemeSets a built-in colour scheme for control's tool tip, in place of individual colours.
SetBinarySuperToolTipCustomSizeSets a fixed size for control's tool tip, used while SetBinarySuperToolTipUseCustomSizing is on.
SetBinarySuperToolTipDrawBorderSets whether a border is drawn round control's tool tip.
SetBinarySuperToolTipDrawBorderAroundBodyImageSets whether a one-pixel frame is drawn round the body picture of control's tool tip.
SetBinarySuperToolTipDrawFooterIconSets whether the footer icon of control's tool tip is shown.
SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterAreaSets whether a line is drawn between the body and the footer of control's tool tip.
SetBinarySuperToolTipDrawTitleIconSets whether the title icon of control's tool tip is shown.
SetBinarySuperToolTipFooterIconSets the icon shown beside the footer text of control's tool tip – typically a help icon beside "Press F1 for more help".
SetBinarySuperToolTipFooterTextSets the text at the foot of control's tool tip – a hint such as "Press F1 for more help" or a keyboard shortcut.
SetBinarySuperToolTipFooterTextFontSets the font of the footer text in control's tool tip.
SetBinarySuperToolTipFooterTextForeColorSets the colour of the footer text in control's tool tip.
SetBinarySuperToolTipGradientDrawingOrientationAngleSets the direction of the gradient background of control's tool tip.
SetBinarySuperToolTipLineColorOnTopOfFooterAreaSets the colour of the line between the body and the footer of control's tool tip.
SetBinarySuperToolTipTitleIconSets the icon shown beside the title of control's tool tip.
SetBinarySuperToolTipTitleTextSets the heading at the top of control's tool tip – usually the name of the command.
SetBinarySuperToolTipTitleTextFontSets the font of the title text in control's tool tip.
SetBinarySuperToolTipTitleTextForeColorSets the colour of the title text in control's tool tip.
SetBinarySuperToolTipUseCustomSizingSets whether control's tool tip has a fixed size rather than one fitted to its content.
Events
AboutToPopupOccurs just before a tool tip opens, so it can be cancelled or brought up to date.
BodyDrawOccurs before the body of a tool tip is drawn, so it can be drawn by your own code instead.
FooterDrawOccurs before the footer of a tool tip is drawn, so it can be drawn by your own code instead.
HeaderDrawOccurs before the title area of a tool tip is drawn, so it can be drawn by your own code instead.

Constructors

BinarySuperToolTip

public BinarySuperToolTip() : base()

Initialises a new super tool tip component, with no tips set for any control yet.

Remarks

Give each control its tip with SetBinarySuperToolTipBodyText and the other SetBinarySuperToolTip... methods.

Properties

OwnerDraw

public new bool OwnerDraw

Gets a value that is always true: the component always draws its tips itself.

Value
Always true; a value set is ignored.

Methods

GetBinarySuperToolTipBackgroundDrawingGradientEndColor

public Color GetBinarySuperToolTipBackgroundDrawingGradientEndColor(Control control)

Gets the colour a gradient background of control's tool tip ends with.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The end colour. The default is SystemColors.Info.

Remarks

Used while the background style is DrawingStyle.Gradient and no built-in scheme is chosen. With the default angle of 270 degrees the end colour is at the top of the tip.

See also

GetBinarySuperToolTipBackgroundDrawingGradientStartColor

public Color GetBinarySuperToolTipBackgroundDrawingGradientStartColor(Control control)

Gets the colour a gradient background of control's tool tip starts from.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The start colour. The default is SystemColors.Info.

Remarks

Used while the background style is DrawingStyle.Gradient and no built-in scheme is chosen. With the default angle of 270 degrees the start colour is at the bottom of the tip.

See also

GetBinarySuperToolTipBackgroundDrawingSolidColor

public Color GetBinarySuperToolTipBackgroundDrawingSolidColor(Control control)

Gets the background colour of control's tool tip when it is drawn solid.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The background colour. The default is SystemColors.Info.

Remarks

Used while the background style is DrawingStyle.Solid, which is the style of a tip with no style or scheme set.

See also

GetBinarySuperToolTipBackgroundDrawingStyle

public DrawingStyle GetBinarySuperToolTipBackgroundDrawingStyle(Control control)

Gets whether the background of control's tool tip is a gradient or a solid colour.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

DrawingStyle.Gradient whenever a built-in colour scheme is chosen; otherwise the style set, or DrawingStyle.Solid when none has been set.

Remarks

A gradient runs from SetBinarySuperToolTipBackgroundDrawingGradientStartColor to SetBinarySuperToolTipBackgroundDrawingGradientEndColor at SetBinarySuperToolTipGradientDrawingOrientationAngle; a solid background is SetBinarySuperToolTipBackgroundDrawingSolidColor.

Set it to DrawingStyle.Gradient before choosing a built-in colour scheme, which is otherwise ignored. While a built-in scheme is in force the background is a gradient whatever is set here.

See also

GetBinarySuperToolTipBodyFooterSeparatingLineDepth

public float GetBinarySuperToolTipBodyFooterSeparatingLineDepth(Control control)

Gets the thickness of the line between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The thickness in pixels, from 1 to 3. The default is 1.

See also

GetBinarySuperToolTipBodyImage

public Image GetBinarySuperToolTipBodyImage(Control control)

Gets the picture shown at the left of the body of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The image, or null when there is none. The default is null.

Remarks

The tip grows to fit the picture at its own size, up to half the width and height of the screen's working area. With SetBinarySuperToolTipUseCustomSizing on, a picture wider than about half the tip is scaled down to fit.

The image must be a Bitmap. Each time the tip is drawn, the pixels of SetBinarySuperToolTipBodyImageTransparencyColor are made see-through in the bitmap itself, so pass a copy if the same bitmap is used elsewhere.

See also

GetBinarySuperToolTipBodyImageTransparencyColor

public Color GetBinarySuperToolTipBodyImageTransparencyColor(Control control)

Gets the colour made see-through in the body picture of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The colour. The default is Color.Transparent, which leaves the picture as it is.

See also

GetBinarySuperToolTipBodyText

public string GetBinarySuperToolTipBodyText(Control control)

Gets the main text of control's tool tip.

Parameters
control
The control whose tool tip it is.
Returns

The body text, or an empty string when the control has no tool tip or control is null.

See also

GetBinarySuperToolTipBodyTextFont

public Font GetBinarySuperToolTipBodyTextFont(Control control)

Gets the font of the body text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The font set for the tip or, when none has been set, a new font in the family of MessageBoxFont at 10 points.

Remarks

The tip is sized to fit its text in these fonts each time it opens.

See also

GetBinarySuperToolTipBodyTextForeColor

public Color GetBinarySuperToolTipBodyTextForeColor(Control control)

Gets the colour of the body text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The text colour. The default is SystemColors.WindowText.

Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipBorderColor

public Color GetBinarySuperToolTipBorderColor(Control control)

Gets the colour of the border round control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The border colour. The default is SystemColors.WindowText.

Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipBorderColourAroundImage

public Color GetBinarySuperToolTipBorderColourAroundImage(Control control)

Gets the colour of the frame round the body picture of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The frame colour. The default is SystemColors.WindowText.

Remarks

The frame is drawn only while SetBinarySuperToolTipDrawBorderAroundBodyImage is on. Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipBuiltInColorScheme

public ColorScheme GetBinarySuperToolTipBuiltInColorScheme(Control control)

Gets the built-in colour scheme control's tool tip is drawn in.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

One of the ColorScheme values. The default is ColorScheme.Custom.

Remarks

A built-in scheme fills the background with a gradient from the scheme's colour to the window colour, at SetBinarySuperToolTipGradientDrawingOrientationAngle, and draws all text, the border and the lines in SystemColors.WindowText; the colours set for the tip one by one are ignored while it is in force.

Set the background style to gradient first. While GetBinarySuperToolTipBackgroundDrawingStyle is DrawingStyle.Solid – as it is for a tip that has no scheme yet – a scheme set here is stored as ColorScheme.Custom and has no effect.

See also

GetBinarySuperToolTipCustomSize

public Size GetBinarySuperToolTipCustomSize(Control control)

Gets the fixed size of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The size, or Size.Empty when none has been set. The default is Size.Empty.

Remarks

The size is used as given and is not scaled for the display. With a fixed size, a body picture wider than about half the tip is scaled down to fit.

See also

GetBinarySuperToolTipDrawBorder

public bool GetBinarySuperToolTipDrawBorder(Control control)

Gets whether a border is drawn round control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the border is drawn. The default is true.

See also

GetBinarySuperToolTipDrawBorderAroundBodyImage

public bool GetBinarySuperToolTipDrawBorderAroundBodyImage(Control control)

Gets whether a frame is drawn round the body picture of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the frame is drawn. The default is false.

See also

GetBinarySuperToolTipDrawFooterIcon

public bool GetBinarySuperToolTipDrawFooterIcon(Control control)

Gets whether the footer icon of control's tool tip is shown.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the icon is shown. The default is false.

Remarks

The icon is shown only when the tip also has footer text.

See also

GetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea

public bool GetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea(Control control)

Gets whether a line is drawn between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the line is drawn. The default is false.

Remarks

The line is drawn only when the tip has footer text. Its colour is SetBinarySuperToolTipLineColorOnTopOfFooterArea and its thickness SetBinarySuperToolTipBodyFooterSeparatingLineDepth.

See also

GetBinarySuperToolTipDrawTitleIcon

public bool GetBinarySuperToolTipDrawTitleIcon(Control control)

Gets whether the title icon of control's tool tip is shown.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the icon is shown. The default is false.

Remarks

The icon is shown only when the tip also has title text.

See also

GetBinarySuperToolTipFooterIcon

public Icon GetBinarySuperToolTipFooterIcon(Control control)

Gets the icon shown beside the footer text of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The icon, or null when there is none. The default is null.

Remarks

Shown only while SetBinarySuperToolTipDrawFooterIcon is true and the tip has footer text. It is drawn 20 logical pixels square.

See also

GetBinarySuperToolTipFooterText

public string GetBinarySuperToolTipFooterText(Control control)

Gets the text at the foot of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The footer text, or an empty string when there is none. The default is an empty string.

Remarks
See also

GetBinarySuperToolTipFooterTextFont

public Font GetBinarySuperToolTipFooterTextFont(Control control)

Gets the font of the footer text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The font set for the tip or, when none has been set, a new font in the family of MessageBoxFont at 10 points.

Remarks

The tip is sized to fit its text in these fonts each time it opens.

See also

GetBinarySuperToolTipFooterTextForeColor

public Color GetBinarySuperToolTipFooterTextForeColor(Control control)

Gets the colour of the footer text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The text colour. The default is SystemColors.WindowText.

Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipGradientDrawingOrientationAngle

public float GetBinarySuperToolTipGradientDrawingOrientationAngle(Control control)

Gets the direction of the gradient background of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The angle in degrees, measured clockwise from left-to-right. The default is 270, which runs from the bottom of the tip up to the top.

Remarks

Applies to both custom gradients and built-in colour schemes.

See also

GetBinarySuperToolTipLineColorOnTopOfFooterArea

public Color GetBinarySuperToolTipLineColorOnTopOfFooterArea(Control control)

Gets the colour of the line between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The line colour. The default is SystemColors.WindowText.

Remarks

The line is drawn only while SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea is on and the tip has footer text. Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipTitleIcon

public Icon GetBinarySuperToolTipTitleIcon(Control control)

Gets the icon shown beside the title of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The icon, or null when there is none. The default is null.

Remarks

Shown only while SetBinarySuperToolTipDrawTitleIcon is true and the tip has title text. It is drawn 20 logical pixels square, at the top left of the tip.

See also

GetBinarySuperToolTipTitleText

public string GetBinarySuperToolTipTitleText(Control control)

Gets the heading at the top of control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The title, or an empty string when there is none. The default is an empty string.

Remarks

The title is drawn in SetBinarySuperToolTipTitleTextFont and SetBinarySuperToolTipTitleTextForeColor. A tip with no title starts with its body.

See also

GetBinarySuperToolTipTitleTextFont

public Font GetBinarySuperToolTipTitleTextFont(Control control)

Gets the font of the title text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The font set for the tip or, when none has been set, a new font in the family of MessageBoxFont at 10 points.

Remarks

The tip is sized to fit its text in these fonts each time it opens. A bold font sets the title apart from the body.

See also

GetBinarySuperToolTipTitleTextForeColor

public Color GetBinarySuperToolTipTitleTextForeColor(Control control)

Gets the colour of the title text in control's tool tip.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

The text colour. The default is SystemColors.WindowText.

Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

GetBinarySuperToolTipUseCustomSizing

public bool GetBinarySuperToolTipUseCustomSizing(Control control)

Gets whether control's tool tip has a fixed size rather than one fitted to its content.

Parameters
control
The control whose tool tip it is. null is allowed and returns the default.
Returns

true when the tip takes GetBinarySuperToolTipCustomSize. The default is false.

Remarks

Without a fixed size the tip is measured to fit its content, up to half the width and half the height of the primary screen's working area. Set a custom size as well when turning this on – a tip with no custom size has no size at all.

See also

SetBinarySuperToolTipBackgroundDrawingGradientEndColor

public void SetBinarySuperToolTipBackgroundDrawingGradientEndColor(Control control, Color value)

Sets the colour a gradient background of control's tool tip ends with.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The end colour. Color.Empty and Color.Transparent give SystemColors.Info.
Remarks

Used while the background style is DrawingStyle.Gradient and no built-in scheme is chosen. With the default angle of 270 degrees the end colour is at the top of the tip.

See also

SetBinarySuperToolTipBackgroundDrawingGradientStartColor

public void SetBinarySuperToolTipBackgroundDrawingGradientStartColor(Control control, Color value)

Sets the colour a gradient background of control's tool tip starts from.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The start colour. Color.Empty and Color.Transparent give SystemColors.Info.
Remarks

Used while the background style is DrawingStyle.Gradient and no built-in scheme is chosen. With the default angle of 270 degrees the start colour is at the bottom of the tip.

Example
tips.SetBinarySuperToolTipBackgroundDrawingStyle(exportButton, DrawingStyle.Gradient);
tips.SetBinarySuperToolTipBackgroundDrawingGradientStartColor(exportButton, Color.LightSteelBlue);
tips.SetBinarySuperToolTipBackgroundDrawingGradientEndColor(exportButton, Color.White);
See also

SetBinarySuperToolTipBackgroundDrawingSolidColor

public void SetBinarySuperToolTipBackgroundDrawingSolidColor(Control control, Color value)

Sets the background colour of control's tool tip when it is drawn solid.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The background colour. Color.Empty and Color.Transparent give SystemColors.Info.
Remarks

Used while the background style is DrawingStyle.Solid, which is the style of a tip with no style or scheme set.

See also

SetBinarySuperToolTipBackgroundDrawingStyle

public void SetBinarySuperToolTipBackgroundDrawingStyle(Control control, DrawingStyle value)

Sets whether the background of control's tool tip is a gradient or a solid colour.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
DrawingStyle.Gradient or DrawingStyle.Solid.
Remarks

A gradient runs from SetBinarySuperToolTipBackgroundDrawingGradientStartColor to SetBinarySuperToolTipBackgroundDrawingGradientEndColor at SetBinarySuperToolTipGradientDrawingOrientationAngle; a solid background is SetBinarySuperToolTipBackgroundDrawingSolidColor.

Set it to DrawingStyle.Gradient before choosing a built-in colour scheme, which is otherwise ignored. While a built-in scheme is in force the background is a gradient whatever is set here.

See also

SetBinarySuperToolTipBodyFooterSeparatingLineDepth

public void SetBinarySuperToolTipBodyFooterSeparatingLineDepth(Control control, float value)

Sets the thickness of the line between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The thickness in pixels, from 1 to 3. A value outside that range gives 1.
See also

SetBinarySuperToolTipBodyImage

public void SetBinarySuperToolTipBodyImage(Control control, Image value)

Sets a picture to show at the left of the body of control's tool tip, beside the body text – a preview, a chart or a screenshot of what the control does.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
A Bitmap, or null to remove the picture.
Remarks

The tip grows to fit the picture at its own size, up to half the width and height of the screen's working area. With SetBinarySuperToolTipUseCustomSizing on, a picture wider than about half the tip is scaled down to fit.

The image must be a Bitmap. Each time the tip is drawn, the pixels of SetBinarySuperToolTipBodyImageTransparencyColor are made see-through in the bitmap itself, so pass a copy if the same bitmap is used elsewhere.

See also

SetBinarySuperToolTipBodyImageTransparencyColor

public void SetBinarySuperToolTipBodyImageTransparencyColor(Control control, Color value)

Sets the colour made see-through in the body picture of control's tool tip, so the tip's background shows through it.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The colour to remove, such as the magenta background of a bitmap. Color.Empty restores the default.
See also

SetBinarySuperToolTipBodyText

public void SetBinarySuperToolTipBodyText(Control control, string value)

Sets the main text of control's tool tip, and so turns the tip on for that control.

Parameters
control
The control to give a tool tip. Ignored when null.
value
The body text. It wraps to the width of the tip and may hold line breaks (NewLine). An empty string, or text that is only white space and line breaks, turns the tip off for control.
Remarks

A control shows its tool tip only while it has body text: set the title, footer, icons and colours as well, but always set this. Use this method rather than the inherited ToolTip.SetToolTip, whose text this component does not draw.

When a handler is attached to HeaderDraw, BodyDraw or FooterDraw at the time of the call, the text is replaced by the placeholder "Being custom drawn.", on the expectation that the handlers draw the tip. Set the body text of tips you want drawn normally before attaching such handlers.

Passing null throws a NullReferenceException; pass an empty string to turn the tip off.

Example
tips.SetBinarySuperToolTipTitleText(archiveButton, "Archive orders");
tips.SetBinarySuperToolTipBodyText(archiveButton,
    "Moves every order delivered more than 90 days ago to the archive." + Environment.NewLine +
    "Archived orders can still be searched, but not edited.");
See also

SetBinarySuperToolTipBodyTextFont

public void SetBinarySuperToolTipBodyTextFont(Control control, Font value)

Sets the font of the body text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The font, or null for the default: the message box font's family at 10 points.
Remarks

The tip is sized to fit its text in these fonts each time it opens.

See also

SetBinarySuperToolTipBodyTextForeColor

public void SetBinarySuperToolTipBodyTextForeColor(Control control, Color value)

Sets the colour of the body text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The text colour. Color.Empty and Color.Transparent give SystemColors.WindowText.
Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipBorderColor

public void SetBinarySuperToolTipBorderColor(Control control, Color value)

Sets the colour of the border round control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The border colour. Color.Empty and Color.Transparent give SystemColors.WindowText.
Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipBorderColourAroundImage

public void SetBinarySuperToolTipBorderColourAroundImage(Control control, Color value)

Sets the colour of the frame round the body picture of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The frame colour.
Remarks

The frame is drawn only while SetBinarySuperToolTipDrawBorderAroundBodyImage is on. Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipBuiltInColorScheme

public void SetBinarySuperToolTipBuiltInColorScheme(Control control, ColorScheme value)

Sets a built-in colour scheme for control's tool tip, in place of individual colours.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
A built-in scheme, or ColorScheme.Custom to use the colours set for the tip one by one.
Remarks

A built-in scheme fills the background with a gradient from the scheme's colour to the window colour, at SetBinarySuperToolTipGradientDrawingOrientationAngle, and draws all text, the border and the lines in SystemColors.WindowText; the colours set for the tip one by one are ignored while it is in force.

Set the background style to gradient first. While GetBinarySuperToolTipBackgroundDrawingStyle is DrawingStyle.Solid – as it is for a tip that has no scheme yet – a scheme set here is stored as ColorScheme.Custom and has no effect.

Example
tips.SetBinarySuperToolTipBackgroundDrawingStyle(saveButton, DrawingStyle.Gradient);
tips.SetBinarySuperToolTipBuiltInColorScheme(saveButton, ColorScheme.Blue);
See also

SetBinarySuperToolTipCustomSize

public void SetBinarySuperToolTipCustomSize(Control control, Size value)

Sets a fixed size for control's tool tip, used while SetBinarySuperToolTipUseCustomSizing is on.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The width and height of the tip in pixels. Size.Empty removes the custom size.
Remarks

The size is used as given and is not scaled for the display. With a fixed size, a body picture wider than about half the tip is scaled down to fit.

See also

SetBinarySuperToolTipDrawBorder

public void SetBinarySuperToolTipDrawBorder(Control control, bool value)

Sets whether a border is drawn round control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to draw a two-pixel border in SetBinarySuperToolTipBorderColor.
See also

SetBinarySuperToolTipDrawBorderAroundBodyImage

public void SetBinarySuperToolTipDrawBorderAroundBodyImage(Control control, bool value)

Sets whether a one-pixel frame is drawn round the body picture of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to frame the picture in SetBinarySuperToolTipBorderColourAroundImage.
See also

SetBinarySuperToolTipDrawFooterIcon

public void SetBinarySuperToolTipDrawFooterIcon(Control control, bool value)

Sets whether the footer icon of control's tool tip is shown.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to show the icon set with SetBinarySuperToolTipFooterIcon.
Remarks

The icon is shown only when the tip also has footer text.

See also

SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea

public void SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea(Control control, bool value)

Sets whether a line is drawn between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to draw the line.
Remarks

The line is drawn only when the tip has footer text. Its colour is SetBinarySuperToolTipLineColorOnTopOfFooterArea and its thickness SetBinarySuperToolTipBodyFooterSeparatingLineDepth.

See also

SetBinarySuperToolTipDrawTitleIcon

public void SetBinarySuperToolTipDrawTitleIcon(Control control, bool value)

Sets whether the title icon of control's tool tip is shown.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to show the icon set with SetBinarySuperToolTipTitleIcon.
Remarks

The icon is shown only when the tip also has title text.

See also

SetBinarySuperToolTipFooterIcon

public void SetBinarySuperToolTipFooterIcon(Control control, Icon value)

Sets the icon shown beside the footer text of control's tool tip – typically a help icon beside "Press F1 for more help".

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The icon, or null to remove it.
Remarks

Shown only while SetBinarySuperToolTipDrawFooterIcon is true and the tip has footer text. It is drawn 20 logical pixels square.

See also

SetBinarySuperToolTipFooterText

public void SetBinarySuperToolTipFooterText(Control control, string value)

Sets the text at the foot of control's tool tip – a hint such as "Press F1 for more help" or a keyboard shortcut.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The footer, on one line. null or an empty string removes the footer.
Remarks
See also

SetBinarySuperToolTipFooterTextFont

public void SetBinarySuperToolTipFooterTextFont(Control control, Font value)

Sets the font of the footer text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The font, or null for the default: the message box font's family at 10 points.
Remarks

The tip is sized to fit its text in these fonts each time it opens.

See also

SetBinarySuperToolTipFooterTextForeColor

public void SetBinarySuperToolTipFooterTextForeColor(Control control, Color value)

Sets the colour of the footer text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The text colour. Color.Empty and Color.Transparent give SystemColors.WindowText.
Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipGradientDrawingOrientationAngle

public void SetBinarySuperToolTipGradientDrawingOrientationAngle(Control control, float value)

Sets the direction of the gradient background of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The angle in degrees, measured clockwise from left-to-right: 0 runs left to right, 90 top to bottom, 270 bottom to top.
Remarks

Applies to both custom gradients and built-in colour schemes.

See also

SetBinarySuperToolTipLineColorOnTopOfFooterArea

public void SetBinarySuperToolTipLineColorOnTopOfFooterArea(Control control, Color value)

Sets the colour of the line between the body and the footer of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The line colour. Color.Empty and Color.Transparent give SystemColors.WindowText.
Remarks

The line is drawn only while SetBinarySuperToolTipDrawLineSeparatingBodyAndFooterArea is on and the tip has footer text. Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipTitleIcon

public void SetBinarySuperToolTipTitleIcon(Control control, Icon value)

Sets the icon shown beside the title of control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The icon, or null to remove it.
Remarks

Shown only while SetBinarySuperToolTipDrawTitleIcon is true and the tip has title text. It is drawn 20 logical pixels square, at the top left of the tip.

Example
tips.SetBinarySuperToolTipTitleIcon(deleteButton, SystemIcons.Warning);
tips.SetBinarySuperToolTipDrawTitleIcon(deleteButton, true);
See also

SetBinarySuperToolTipTitleText

public void SetBinarySuperToolTipTitleText(Control control, string value)

Sets the heading at the top of control's tool tip – usually the name of the command.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The title, on one line; text that does not fit ends in an ellipsis. null or an empty string removes the title.
Remarks

The title is drawn in SetBinarySuperToolTipTitleTextFont and SetBinarySuperToolTipTitleTextForeColor. A tip with no title starts with its body.

See also

SetBinarySuperToolTipTitleTextFont

public void SetBinarySuperToolTipTitleTextFont(Control control, Font value)

Sets the font of the title text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The font, or null for the default: the message box font's family at 10 points.
Remarks

The tip is sized to fit its text in these fonts each time it opens. A bold font sets the title apart from the body.

Example
tips.SetBinarySuperToolTipTitleTextFont(saveButton, new Font("Segoe UI", 10f, FontStyle.Bold));
See also

SetBinarySuperToolTipTitleTextForeColor

public void SetBinarySuperToolTipTitleTextForeColor(Control control, Color value)

Sets the colour of the title text in control's tool tip.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
The text colour. Color.Empty and Color.Transparent give SystemColors.WindowText.
Remarks

Ignored while a built-in colour scheme is chosen with SetBinarySuperToolTipBuiltInColorScheme: the scheme draws it in SystemColors.WindowText.

See also

SetBinarySuperToolTipUseCustomSizing

public void SetBinarySuperToolTipUseCustomSizing(Control control, bool value)

Sets whether control's tool tip has a fixed size rather than one fitted to its content.

Parameters
control
The control whose tool tip to change. Ignored when null.
value
true to give the tip the size set with SetBinarySuperToolTipCustomSize; false to fit it to the title, body, footer, icons and picture each time it opens.
Remarks

Without a fixed size the tip is measured to fit its content, up to half the width and half the height of the primary screen's working area. Set a custom size as well when turning this on – a tip with no custom size has no size at all.

Example
tips.SetBinarySuperToolTipCustomSize(chartButton, new Size(320, 200));
tips.SetBinarySuperToolTipUseCustomSizing(chartButton, true);
See also

Events

AboutToPopup

public event AboutToPopupHandler AboutToPopup

Occurs just before a tool tip opens, so it can be cancelled or brought up to date.

Remarks

Raised for every control the component gives a tip. Set BinarySuperToolTipPopupEventArgs.CancelNow to keep the tip closed this time, or change the tip's title, footer and appearance for BinarySuperToolTipPopupEventArgs.AssociatedControl before it is measured and drawn.

Example
tips.AboutToPopup += (sender, e) =>
{
    if (e.AssociatedControl == stockLabel)
    {
        tips.SetBinarySuperToolTipFooterText(stockLabel,
            "Stock checked at " + DateTime.Now.ToShortTimeString());
    }

    // No tips while the order is being saved.
    e.CancelNow = isSaving;
};

BodyDraw

public event BodyDrawingHandler BodyDraw

Occurs before the body of a tool tip is drawn, so it can be drawn by your own code instead.

Remarks

Raised every time any of the component's tips is drawn. Draw with BinarySuperToolTipDrawingEventArgs.Graphics, check BinarySuperToolTipDrawingEventArgs.AssociatedControl to see whose tip it is, and set BinarySuperToolTipDrawingEventArgs.Handled to true for the tips you have drawn – leave it false and the component draws the body as usual.

The rectangle offered is the middle three fifths of the tip, below the title area.

tips.BodyDraw += (sender, e) =>
{
    if (e.AssociatedControl != salesChartButton)
    {
        return;
    }

    using (Brush bar = new SolidBrush(Color.SteelBlue))
    {
        float x = e.DrawingRectangle.X + 12;
        foreach (float share in new[] { 0.4f, 0.7f, 0.55f, 0.9f })
        {
            float height = (e.DrawingRectangle.Height - 12) * share;
            e.Graphics.FillRectangle(bar, x, e.DrawingRectangle.Bottom - 6 - height, 18, height);
            x += 26;
        }
    }

    e.Handled = true;
};

While any of the three drawing events has a handler, SetBinarySuperToolTipBodyText stores a placeholder instead of the text it is given, so attach handlers after setting body texts.

Example
tips.BodyDraw += (sender, e) =>
{
    if (e.AssociatedControl != salesChartButton)
    {
        return;
    }

    using (Brush bar = new SolidBrush(Color.SteelBlue))
    {
        float x = e.DrawingRectangle.X + 12;
        foreach (float share in new[] { 0.4f, 0.7f, 0.55f, 0.9f })
        {
            float height = (e.DrawingRectangle.Height - 12) * share;
            e.Graphics.FillRectangle(bar, x, e.DrawingRectangle.Bottom - 6 - height, 18, height);
            x += 26;
        }
    }

    e.Handled = true;
};

FooterDraw

public event FooterDrawingHandler FooterDraw

Occurs before the footer of a tool tip is drawn, so it can be drawn by your own code instead.

Remarks

Raised every time any of the component's tips is drawn. Draw with BinarySuperToolTipDrawingEventArgs.Graphics, check BinarySuperToolTipDrawingEventArgs.AssociatedControl to see whose tip it is, and set BinarySuperToolTipDrawingEventArgs.Handled to true for the tips you have drawn – leave it false and the component draws the footer as usual.

The rectangle offered is a fifth of the tip's height. Its top is placed one title-area height above the bottom of the tip only while HeaderDraw also has a handler; otherwise it starts at the bottom edge, so work out the footer area from the tip's size instead.

While any of the three drawing events has a handler, SetBinarySuperToolTipBodyText stores a placeholder instead of the text it is given, so attach handlers after setting body texts.

HeaderDraw

public event HeaderDrawingHandler HeaderDraw

Occurs before the title area of a tool tip is drawn, so it can be drawn by your own code instead.

Remarks

Raised every time any of the component's tips is drawn. Draw with BinarySuperToolTipDrawingEventArgs.Graphics, check BinarySuperToolTipDrawingEventArgs.AssociatedControl to see whose tip it is, and set BinarySuperToolTipDrawingEventArgs.Handled to true for the tips you have drawn – leave it false and the component draws the title area as usual.

The rectangle offered is the top fifth of the tip.

While any of the three drawing events has a handler, SetBinarySuperToolTipBodyText stores a placeholder instead of the text it is given, so attach handlers after setting body texts.