CoreSuite.ControlContainer 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoreSuite.ControlContainer --version 1.0.0
                    
NuGet\Install-Package CoreSuite.ControlContainer -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="CoreSuite.ControlContainer" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreSuite.ControlContainer" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreSuite.ControlContainer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoreSuite.ControlContainer --version 1.0.0
                    
#r "nuget: CoreSuite.ControlContainer, 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.
#:package CoreSuite.ControlContainer@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoreSuite.ControlContainer&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreSuite.ControlContainer&version=1.0.0
                    
Install as a Cake Tool

CoreSuite ControlContainer

CoreSuite.ControlContainer is a reusable .NET 8 Windows Forms component that displays any control inside a floating drop-down window anchored to another control.

It handles positioning, screen boundaries, focus, outside clicks, the Escape key and the opening and closing lifecycle.

Features

  • Hosts any Windows Forms Control.
  • Anchors the drop-down to a button, text box or another control.
  • Keeps the drop-down inside the current screen's working area.
  • Closes on outside clicks, Escape or movement of the host's parent.
  • Supports a custom border color.
  • Exposes opening, opened, closing, closed and state events.

Requirements

  • .NET 8
  • Windows Forms (net8.0-windows)

Installation

dotnet add package CoreSuite.ControlContainer

Basic usage

Public Class MainForm
    Private ReadOnly DropDownContent As New MonthCalendar()
    Private ReadOnly DateDropDown As New ControlContainer()
    Public Sub New()
        InitializeComponent()
        DateDropDown.HostControl = BtnChooseDate
        DateDropDown.HostedControl = DropDownContent
        DateDropDown.DropDownBorderColor = Color.DodgerBlue
        AddHandler DropDownContent.DateSelected, AddressOf DropDownContent_DateSelected
    End Sub
    Private Sub DropDownContent_DateSelected(Sender As Object, E As DateRangeEventArgs)
        TxtDate.Text = E.Start.ToShortDateString()
        DateDropDown.CloseDropDown()
    End Sub
End Class

With DropDownEnabled = True, clicking HostControl opens the container. It can also be controlled manually:

If DateDropDown.CanDrop Then DateDropDown.ShowDropDown()
DateDropDown.CloseDropDown()

Properties

Property Type Default Description
HostControl Control Nothing Anchor and automatic click trigger.
HostedControl Control Nothing Control shown in the floating window.
DropDownEnabled Boolean True Enables opening when the host is clicked.
DropDownBorderColor Color SystemColors.HotTrack Border color.
CanDrop Boolean Read-only Indicates whether opening is currently allowed.
DropState ControlContainerDropDownState Read-only Current lifecycle state.

Methods

Method Description
ShowDropDown() Opens the drop-down and adjusts it to the screen.
CloseDropDown() Closes it when open.

ShowDropDown() requires both HostControl and HostedControl.

Events

Event Raised when
Dropping Opening begins.
Dropped Opening completes.
Closing Closing begins.
Closed Closing completes.
DropStateChanged The state changes.

The ControlContainerDropDownState values are Closed, Closing, Dropping and Dropped.

Notes

  • Drop-down size follows HostedControl.
  • The hosted control moves into the internal floating window while displayed.
  • UI operations should run on the Windows Forms UI thread.

License

MIT License.

Repository

CoreSuite on GitHub

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on CoreSuite.ControlContainer:

Package Downloads
CoreSuite.CMessageBox

A customizable Windows Forms message box with multiple message types, exception details and optional exception reporting by email.

CoreSuite.DateTimeBox

Culture-aware WinForms date and time input control with masked entry, a combined calendar and time dropdown, and designer support.

CoreSuite.DateBox

A culture-aware Windows Forms date input control with masking, validation and a drop-down calendar.

CoreSuite.TimeBox

A culture-aware Windows Forms time input control with masking, validation and a drop-down time selector.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 122 8/7/2026
1.0.1 103 8/2/2026
1.0.0 139 8/2/2026

Initial release of the ControlContainer component.