Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add a ToolTip component from PowerShell Studio’s Toolbox, then enter help text in the selected control’s ToolTip on <ToolTipName> property. For text you need to change in code, call the component’s SetToolTip() method. The component is nonvisual: it sits behind the form’s visible controls but displays a popup when a user hovers over a configured control.

Add the ToolTip component in the designer

  1. Open the form in PowerShell Studio’s designer and locate ToolTip in the Toolbox.
  2. Drag ToolTip onto the form. Because it is a nonvisual component, it appears in the component area rather than as a visible control on the form.
  3. Select a control, such as a button or text box. In its Properties panel, find the dynamically added ToolTip on <ToolTipName> property and enter the text to display.
  4. Repeat for any other controls that need help text. The property is available on controls already in the designer and those added after the ToolTip component.

SAPIEN documents this designer property behavior in its ToolTip control documentation.

Set tooltip text in PowerShell code

Use SetToolTip(control, text) when tooltip content is dynamic, localized, or easier to manage centrally than in individual designer properties:

$tooltip1.SetToolTip($buttonStart, "To start the task, click Start.")
$tooltip1.SetToolTip($buttonStop, "To stop the task, click Stop.")

Replace $tooltip1 with the name of your ToolTip component and pass the target control and its text. A ToolTip component does not use an ordinary Text property for this; SetToolTip() associates text with a control. To remove that control’s tooltip, pass Nothing as the text.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
PowerShell for Sysadmins: Workflow Automation Made Easy
  • Book - powershell for sysadmins: workflow automation made easy
  • Language: english
  • Binding: paperback

Microsoft documents both approaches—setting the designer’s ToolTip on ToolTip1 value and calling SetToolTip(control, text)—in its Windows Forms SetToolTip reference.

Reuse one MouseHover handler for shared help logic

If several controls need tooltips chosen by code, a shared scriptblock can select text based on the hovered control. In the control’s event list, open events with Ctrl+E, choose MouseHover, and create the handler. For example:

$ShowHelp = {
    # Display popup help for the hovered control.
    switch ($this.Name) {
        "text1" { $tip = "Enter the computer name." }
        "buttonStart" { $tip = "To start the task, click Start." }
        default { $tip = $null }
    }

    $tooltip1.SetToolTip($this, $tip)
}

$txtComputername_MouseHover = {
    & $ShowHelp
}
$txtComputername.add_MouseHover($txtComputername_MouseHover)

The call operator (&) invokes the scriptblock from the generated event handler. Alternatively, attach the shared scriptblock directly: $txtComputername.add_MouseHover($ShowHelp). Jeff Hicks’s PowerShell Studio ToolTip walkthrough demonstrates the generated-handler pattern and explains why the call operator is used.

When a control has no matching entry in the switch, the example passes $null, clearing any tooltip text for that control. Add a case for each control that needs different help.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the approach that fits your form

Approach Best fit Trade-off
Designer property Static, control-specific labels; fastest to configure Text is stored per control, which is less convenient to centralize or localize
SetToolTip() in code Changing or localized text, or help managed in one place Requires code that associates each control with its text
Shared MouseHover handler Reusable logic that selects help according to the hovered control Requires event wiring and a mapping from controls to their text

Adjust timing and appearance

The ToolTip component exposes properties including Active, AutomaticDelay, InitialDelay, ReshowDelay, IsBalloon, ToolTipIcon, and ToolTipTitle. Set these on the component when you need to control whether tips are active, their timing, or their presentation. SAPIEN lists ReshowDelay in milliseconds and records a default of 100 milliseconds; that value describes the documented default, not a guarantee that every application’s configured value is unchanged. The available ToolTipIcon values are Error, Info, None, and Warning.

Test the exported script

Export the project to a PowerShell script and run it. Hover over a control with configured text to verify the popup appears. If it does not, check that the control has a nonempty tooltip value or that the event is wired to the intended handler and that the handler calls SetToolTip() with the hovered control.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep tooltip text concise

Tooltips work best as brief guidance rather than instructions users must read to complete a task. For a multiline tooltip, include PowerShell’s newline escape, `n, in the string.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.