CoreSuite.CentralizedComboBox
1.0.0
dotnet add package CoreSuite.CentralizedComboBox --version 1.0.0
NuGet\Install-Package CoreSuite.CentralizedComboBox -Version 1.0.0
<PackageReference Include="CoreSuite.CentralizedComboBox" Version="1.0.0" />
<PackageVersion Include="CoreSuite.CentralizedComboBox" Version="1.0.0" />
<PackageReference Include="CoreSuite.CentralizedComboBox" />
paket add CoreSuite.CentralizedComboBox --version 1.0.0
#r "nuget: CoreSuite.CentralizedComboBox, 1.0.0"
#:package CoreSuite.CentralizedComboBox@1.0.0
#addin nuget:?package=CoreSuite.CentralizedComboBox&version=1.0.0
#tool nuget:?package=CoreSuite.CentralizedComboBox&version=1.0.0
CentralizedComboBox
A Windows Forms ComboBox that keeps its selected text and drop-down items horizontally centered.
CentralizedComboBox is one of the controls included in the CoreSuite solution. It preserves the standard WinForms ComboBox API and behavior while adding centered text rendering.
Overview
CentralizedComboBox extends the standard Windows Forms ComboBox. It uses owner drawing to center every item in the drop-down list and applies the native Windows ES_CENTER style to the internal editable text field.
Because it inherits from ComboBox, existing properties, data binding, events and designer support remain available.
Features
- Centers the selected value.
- Centers all items displayed in the drop-down list.
- Supports editable and selection-only ComboBox styles.
- Preserves standard data binding and selection behavior.
- Works in the Visual Studio Windows Forms designer.
- Requires no external NuGet dependencies.
- Designed for .NET 8 Windows Forms applications.
Requirements
- Windows
- Windows Forms
- .NET 8 for Windows (
net8.0-windows)
The control uses native Windows APIs and is intended exclusively for Windows applications.
Installation
Install the package from NuGet:
dotnet add package CoreSuite.CentralizedComboBox
Or search for CoreSuite.CentralizedComboBox in the Visual Studio NuGet Package Manager.
Namespace
Imports CoreSuite.Controls
Quick start
Imports CoreSuite.Controls
Public Class MainForm
Private Sub MainForm_Load(Sender As Object, E As EventArgs) Handles MyBase.Load
Dim StatusComboBox As New CentralizedComboBox With {
.DropDownStyle = ComboBoxStyle.DropDownList,
.Location = New Point(20, 20),
.Width = 220
}
StatusComboBox.Items.AddRange({"Pending", "In progress", "Completed"})
StatusComboBox.SelectedIndex = 0
Controls.Add(StatusComboBox)
End Sub
End Class
Data binding
The control supports the same binding properties as a standard ComboBox:
Dim StatusComboBox As New CentralizedComboBox With {
.DataSource = StatusItems,
.DisplayMember = "Name",
.ValueMember = "Id",
.DropDownStyle = ComboBoxStyle.DropDownList
}
Designer usage
After installing or referencing the package:
- Open a Windows Forms form in the Visual Studio designer.
- Add
CentralizedComboBoxfrom the Toolbox. - Configure it with the standard
ComboBoxproperties. - Add items through
Itemsor configureDataSource,DisplayMemberandValueMember.
No additional property is required to enable centering.
API reference
CentralizedComboBox
Public Class CentralizedComboBox
Inherits ComboBox
The control does not introduce new public properties or events. All public configuration is inherited from ComboBox.
Common inherited members include:
ItemsSelectedIndexSelectedItemSelectedValueDataSourceDisplayMemberValueMemberDropDownStyleAutoCompleteModeAutoCompleteSourceSelectedIndexChangedSelectionChangeCommitted
Rendering behavior
The control sets DrawMode to OwnerDrawFixed. Item text is rendered with horizontal and vertical centering. When the native handle is created, the editable portion also receives the Windows centered-text style.
If application code changes DrawMode or implements separate owner-drawing behavior, that code may replace the built-in centered item rendering.
Package information
| Item | Value |
|---|---|
| Package | CoreSuite.CentralizedComboBox |
| Namespace | CoreSuite.Controls |
| Assembly | CoreSuite.CentralizedComboBox |
| Target framework | net8.0-windows |
| UI framework | Windows Forms |
| External dependencies | None |
License
This package is distributed under the MIT License.
| 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
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 |
|---|---|---|
| 1.0.0 | 125 | 8/2/2026 |
Initial release of the CentralizedComboBox control.