Rop.Winforms10
1.0.1
dotnet add package Rop.Winforms10 --version 1.0.1
NuGet\Install-Package Rop.Winforms10 -Version 1.0.1
<PackageReference Include="Rop.Winforms10" Version="1.0.1" />
<PackageVersion Include="Rop.Winforms10" Version="1.0.1" />
<PackageReference Include="Rop.Winforms10" />
paket add Rop.Winforms10 --version 1.0.1
#r "nuget: Rop.Winforms10, 1.0.1"
#:package Rop.Winforms10@1.0.1
#addin nuget:?package=Rop.Winforms10&version=1.0.1
#tool nuget:?package=Rop.Winforms10&version=1.0.1
Rop.Winforms10
Base classes and controls for WinForms on .NET 10. Provides reusable forms, key-value combobox/listbox controls, item collection unification, and various helpers.
Installation
dotnet add package Rop.Winforms10
Features
Base Forms (Rop.Winforms10)
Form inheritance hierarchy with built-in behavior:
Form
└── FormSc — Base form with Win11 rounded corners, result pattern (IForm10)
└── FormDownPanel — Adds bottom panel with Ok/Exit buttons
├── FormDialog — Fixed dialog (CenterParent, no minimize/maximize)
└── FormUpDownPanel — Adds top panel + main content panel
- FormSc — Base form enabling Windows 11 rounded corners via
DwmSetWindowAttribute. ImplementsIForm10providingSynchronizationContext, result handling (Result<T>,VoidResult), cross-threadPost/Send, and built-inShowError/ShowInfo/ShowYesNodialogs. - FormDownPanel — Form with a configurable bottom button bar (Exit + optional Ok button). Auto-positions buttons on resize.
- FormDialog — Modal dialog preconfigured as
FixedDialog,CenterParent, always on top. Hides minimize/maximize/show-in-taskbar. - FormUpDownPanel — Extends
FormDownPanelwith a top panel and a main content panel. BackColor syncs between panels.
public partial class MyForm : FormDownPanel
{
public MyForm()
{
BtnOkVisible = true; // show Ok button
ExitButtonClick += (s, e) => DoExit();
OkButtonClick += (s, e) => DoExitOk(myResult);
}
}
// In the calling code:
var result = await myForm.ShowDialogAsync(); // returns Result<T>
AbsController<T>
Abstract controller base class for forms. Subscribes to Form.Shown to call Init() and InitAsync():
public class MyController : AbsController<MyForm>
{
public MyController(MyForm form) : base(form) { }
protected override void Init() { /* sync init */ }
protected override async ValueTask InitAsync() { /* async init */ }
}
IForm10 Interface (Rop.Winforms10.Helper)
Common interface for forms providing result pattern integration:
IResult FormResult { get; set; }
Result<T> GetResult<T>();
VoidResult GetVoidResult();
void DoExitOk();
void DoExitOk<T>(T result);
void DoExitFailed(Error error);
void ShowError(string error);
void ShowInfo(string info);
DialogResult ShowYesNo(string msg, string caption);
Task LockPost(Action action); // cross-thread post with await
void Post(Action action);
void Send(Action action);
KeyValue Controls (Rop.Winforms10.KeyValueListBox)
Controls that display items implementing IKeyValue (from Rop.IKeyValue), rendering both a key and a descriptive value side by side with full owner-draw support.
- KeyValueListBox — ListBox for
IKeyValueinstances. Owner-drawn with key/value columns, row color sets (normal/selected/alt), icon slots per row. - KeyValueComboBox — Drop-down ComboBox for
IKeyValueinstances. Same rendering engine as the list box. - KeyValueLabel — Single-item read-only label using the KeyValue draw engine (shows one
IKeyValue).
All three controls share a common draw pipeline (IKeyValueControlDraw) with granular draw events:
| Event | Purpose |
|---|---|
DrawKeyValueItem |
Full item background + layout |
DrawKeyItem |
Key column text rendering |
DrawValueItem |
Value column text rendering |
DrawLeftIcon / DrawRightIcon |
Icon slots (left/right of key) |
PostDrawKeyItem / PostDrawValueItem |
Post-draw overlays |
using Rop.Winforms10.KeyValueListBox;
// Populate a KeyValueComboBox with IKeyValue items
keyValueCombo.Items.AddRange(new IKeyValue[]
{
new FooKeyValue("ES", "Spain"),
new FooKeyValue("FR", "France"),
new FooKeyValue("IT", "Italy")
});
// Get selected key
string selectedKey = keyValueCombo.SelectedKey;
// Configure row colors
keyValueCombo.RowStyleColorSet = ColorSet.Default;
keyValueCombo.RowStyleSelectedColorSet = ColorSet.DefaultSel;
keyValueCombo.RowStyleAltColorSet = ColorSet.DefaultAlt;
ICanBeKeyValue Interface (Rop.Winforms10.ListCombobox)
Rich interface for controls that work with IKeyValue items. Both CompatibleListBox and CompatibleComboBox implement it:
// Key/value lookup
IKeyValue? FindKey(string key);
int FindKeyIndex(string key);
bool KeyExists(string key);
string SelectedKey { get; set; }
int SelectedIntKey { get; set; }
IKeyValue? SelectedKeyValue { get; }
// Update pipeline with events
event EventHandler<UpdateItemsEventArgs> UpdatePreItems;
event EventHandler<UpdateItemsEventArgs> UpdateItems;
event EventHandler<UpdateItemsEventArgs> UpdatePostItems;
event EventHandler<OrderItemsEventArgs> UpdateOrderItems;
bool StopUpdates { get; set; } // suppress updates
void CancelUpdate();
Compatible Items (Rop.Winforms10.ListCombobox)
Unified item collection that wraps both ComboBox.ObjectCollection and ListBox.ObjectCollection behind a common interface.
- CompatibleComboBox — ComboBox with
CompatibleItems(replacesbase.Items). - CompatibleListBox — ListBox with
CompatibleItems. - CompatibleItems — Implements
IListwrapping the native collection, addsAddRange(IEnumerable).
Both controls implement IHasCompatibleItems giving access to a unified Items property and GetSelectedItem() / GetItem(int) / GetItemsCount().
// CompatibleItems works with both controls identically
compatibleCombo.Items.AddRange(myKeyValueCollection);
compatibleListBox.Items.AddRange(myKeyValueCollection);
// Unified access
object? selected = compatibleCombo.GetSelectedItem();
int count = compatibleCombo.GetItemsCount();
Controls (Rop.Winforms10.Controls)
- ConcurrentBar — Progress bar control with marquee and determinate modes. Configurable bar height, colors, border radius, and text format (
{0}%). Uses a timer for marquee animation. - NullDateOnlyPicker —
DateTimePickersubclass supporting nullableDateOnly?. Tracks value changes with a_trackchangesflag to avoid re-entrantOnValueChanged.
var bar = new ConcurrentBar { Maximum = 100, Value = 42, UsePercent = true };
var picker = new NullDateOnlyPicker { Value = DateOnly.FromDateTime(DateTime.Today) };
Decorators (Rop.Winforms10.Decorators)
- EnumComboBoxView<T> — Wraps a
ComboBoxto display enum values with[Display(Name="...")]attribute support. ProvidesGetValue()/SetValue().
var view = new EnumComboBoxView<MyEnum>(myComboBox);
MyEnum? selected = view.GetValue();
view.SetValue(MyEnum.SomeValue);
Helpers (Rop.Winforms10.Helper)
- WinFormsHelper — Extensions:
IsRealDesignerMode()(detects VS designer),ForceSetVisibleCore(),FindControlAtPoint(), default icon/font reflection accessors,SendMessageP/Invoke. - ClipboardEx — Parse
CF_DIBV5clipboard format intoBitmap. Struct-to-bytes conversion. - SlimControlDialogDecorator — Decorates a control with a popup dialog positioned below it. Supports fade-out animation, mouse-leave detection via
MouseHook. - SortableBindingList<T> —
BindingList<T>with column-header-click sort support (in-memory sort viaList<T>.Sort). - MouseHook — Global mouse hook service. Captures mouse down/up/action events even outside the application window.
- ControlPositionHelper — Extension methods
SetLeft,SetTop,SetWidth,SetHeightthat returnbool(true if changed). - TypeConvertibleRepository / TypeConverter — Reflection-based type-to-string conversion with sorted properties.
- CategoryHelper — Constants for standard
CategoryAttributestrings (Action, Appearance, Behavior, Data, Layout, Mouse, etc.). - Win32 / Win32.WM — Extensive Win32 constants and window message definitions.
- DrawItemEventHelper / FullNameHelper / Resources / TabControlHelper — Miscellaneous utility classes.
Dependencies
| Package | Purpose |
|---|---|
Rop.Results9 |
Result pattern (IForm10 form results) |
Rop.IKeyValue |
IKeyValue interface for key-value controls |
Rop.IncludeFrom |
Source generator for partial class composition |
Rop.Winforms10.Helpers |
Drawing/geometry/font helpers (project reference) |
Requirements
- .NET 10 (
net10.0-windows) - Windows Forms (
UseWindowsForms=true)
License
GPL-3.0-or-later
Author
Ramon Ordiales Plaza
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Rop.IKeyValue (>= 1.0.3)
- Rop.IncludeFrom.Annotations (>= 1.0.6)
- Rop.Results9 (>= 1.2.3)
- Rop.Winforms10.Helpers (>= 1.0.1)
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.1 | 138 | 6/25/2026 |