CoreSuite.NoFocusCueButton
1.0.1
dotnet add package CoreSuite.NoFocusCueButton --version 1.0.1
NuGet\Install-Package CoreSuite.NoFocusCueButton -Version 1.0.1
<PackageReference Include="CoreSuite.NoFocusCueButton" Version="1.0.1" />
<PackageVersion Include="CoreSuite.NoFocusCueButton" Version="1.0.1" />
<PackageReference Include="CoreSuite.NoFocusCueButton" />
paket add CoreSuite.NoFocusCueButton --version 1.0.1
#r "nuget: CoreSuite.NoFocusCueButton, 1.0.1"
#:package CoreSuite.NoFocusCueButton@1.0.1
#addin nuget:?package=CoreSuite.NoFocusCueButton&version=1.0.1
#tool nuget:?package=CoreSuite.NoFocusCueButton&version=1.0.1
NoFocusCueButton
A lightweight Windows Forms button that suppresses the default focus rectangle and provides built-in tooltip support.
NoFocusCueButton is one of the controls included in the CoreSuite solution. It preserves the standard WinForms Button behavior while removing the visual focus cue rendered around the button text.
Overview
NoFocusCueButton extends the standard Windows Forms Button control and always suppresses its default focus rectangle.
The control remains focusable and continues to support normal keyboard, mouse, command, image, text, layout, and designer behavior. Only the standard focus cue is hidden.
It also provides a TooltipText property, allowing a tooltip to be configured directly on the button without creating and managing a separate ToolTip component.
Features
- Inherits all standard WinForms
Buttonfunctionality. - Suppresses the default dotted focus rectangle.
- Preserves keyboard and mouse interaction.
- Provides built-in tooltip support through
TooltipText. - Supports Visual Studio designer configuration.
- Requires no external dependencies.
- Designed for .NET 8 Windows Forms applications.
Requirements
- Windows Forms
- .NET 8 for Windows (
net8.0-windows)
Installation
Install the package from NuGet:
dotnet add package CoreSuite.NoFocusCueButton
Or use the Visual Studio NuGet Package Manager and search for:
CoreSuite.NoFocusCueButton
Namespace
Imports CoreSuite.Controls
Quick start
Add the control to a form and configure it like a standard WinForms button:
Imports CoreSuite.Controls
Public Class MainForm
Private Sub MainForm_Load(Sender As Object, E As EventArgs) Handles MyBase.Load
Dim SaveButton As New NoFocusCueButton With {
.Text = "Save",
.TooltipText = "Save the current changes.",
.AutoSize = True,
.Location = New Point(20, 20)
}
AddHandler SaveButton.Click, AddressOf SaveButton_Click
Controls.Add(SaveButton)
End Sub
Private Sub SaveButton_Click(Sender As Object, E As EventArgs)
MessageBox.Show("Changes saved.")
End Sub
End Class
The button behaves normally when clicked or focused, but the default dotted focus rectangle is not displayed.
Designer usage
After installing or referencing the package:
- Open a Windows Forms form in the Visual Studio designer.
- Add
NoFocusCueButtonfrom the Toolbox. - Configure the standard
Buttonproperties normally. - Set
TooltipTextin the NoFocusCueButton property category.
The tooltip is displayed automatically when the mouse pointer remains over the button.
API reference
NoFocusCueButton
Represents a standard WinForms button that suppresses the default focus cue and supports an associated tooltip.
Public Class NoFocusCueButton
Inherits Button
TooltipText
Gets or sets the text displayed in the tooltip when the mouse pointer hovers over the button.
Public Overridable Property TooltipText As String
| Value | Behavior |
|---|---|
| Empty string | No tooltip text is displayed. |
| Non-empty string | The configured text is displayed when the pointer hovers over the button. |
Nothing |
Treated as no configured tooltip text by the underlying WinForms ToolTip component. |
Example:
SaveButton.TooltipText = "Save the current document."
Focus cue behavior
The control overrides the protected ShowFocusCues property and always returns False:
Protected Overrides ReadOnly Property ShowFocusCues As Boolean
This affects only the standard visual focus rectangle. The button can still:
- receive focus;
- be reached through keyboard navigation;
- respond to
EnterandSpaceaccording to normal WinForms behavior; - raise standard focus, keyboard, mouse, and click events.
Standard button functionality
Because NoFocusCueButton inherits directly from Button, it supports standard properties and events such as:
TextImageImageAlignTextAlignTextImageRelationFlatStyleDialogResultAutoSizeEnabledClickMouseEnterMouseLeaveGotFocusLostFocus
No special setup is required for these members.
Using the control as a base class
NoFocusCueButton can also be used as the base class for custom CoreSuite controls that require standard button behavior without the native focus rectangle.
Imports CoreSuite.Controls
Public Class ActionButton
Inherits NoFocusCueButton
Public Sub New()
Text = "Action"
TooltipText = "Execute the action."
End Sub
End Class
Derived controls inherit the suppressed focus cue and tooltip functionality automatically.
Accessibility considerations
The focus rectangle is a visual indication of keyboard focus. Since this control intentionally suppresses that indication, applications should provide another clear focus state when keyboard navigation is important, such as a border, background change, or other visible style.
Suppressing the focus cue does not remove keyboard support, but it can make the focused control less obvious to users when no alternative visual indication is provided.
Package information
| Item | Value |
|---|---|
| Package | CoreSuite.NoFocusCueButton |
| Namespace | CoreSuite.Controls |
| Assembly | CoreSuite.NoFocusCueButton |
| Target framework | net8.0-windows |
| UI framework | Windows Forms |
| External dependencies | None |
License
This package is distributed under the license defined by the CoreSuite repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CoreSuite.NoFocusCueButton:
| Package | Downloads |
|---|---|
|
CoreSuite.CMessageBox
A customizable Windows Forms message box with multiple message types, exception details and optional exception reporting by email. |
|
|
CoreSuite.TextBoxActionPanel
A non-visual Windows Forms component that attaches a configurable, non-activating image-action panel to any existing TextBoxBase control. |
|
|
CoreSuite.PictureViewer
A Windows Forms image viewer with navigation, inclusion, removal and save commands plus customizable tooltips. |
|
|
CoreSuite.RichTextButton
A Windows Forms button that renders multiple independently formatted text parts. |
|
|
CoreSuite.SplitButton
A Windows Forms split button that combines a primary action with a configurable drop-down menu. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed tooltip visibility when the button is hosted in inactive or non-activating windows.