VirtualButton 1.0.0

.NET 6.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package VirtualButton --version 1.0.0
NuGet\Install-Package VirtualButton -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VirtualButton" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VirtualButton --version 1.0.0
#r "nuget: VirtualButton, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install VirtualButton as a Cake Addin
#addin nuget:?package=VirtualButton&version=1.0.0

// Install VirtualButton as a Cake Tool
#tool nuget:?package=VirtualButton&version=1.0.0


This was made for .NET Core 6, but doesn't rely on anything specific to it - feel free to build it for .NET Framework or other .NET Core versions as needed.

Getting Started


A) Nuget
  1. Install the nuget package for your project or solution.
B) From Source
  1. Clone the repository to a location of your choice (for best results, use a git submodule), and add it to your solution.
  2. Add a project reference in the project you want to use the virtual button in:
    Adding a Project Reference


This assumes you already have a form or control, and know how to create them.

  1. If the installation was successful, you will have a VirtualButton item in the designer toolbox:
  2. Select the VirtualButton item, then click somewhere on your form/control. You will now have a new component:
Handling Virtual Click Events
  • Define a handler for the click event by double-clicking in the Click dropdown, or by selecting an already-existing function.
Setting Built-In Form Buttons
  • Now that you have a VirtualButton added to the form/control, you can select it from the Form CancelButton/AcceptButton/HelpButton dropdown boxes:
public class Form1 : Form
     public Form1()
         // Initialize the virtual button:
         vbCancelButton = new(delegate{ this.Close() });
         // Assign the virtual button as the form button handler:
         this.CancelButton = vbCancelButton;
     private readonly VirtualButton vbCancelButton;
Product Compatible and additional computed target framework versions.
.NET net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net7.0-windows7.0 was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.1 383 4/28/2022
2.1.0 344 4/27/2022
2.0.0 350 4/27/2022
1.0.0 343 4/24/2022