Skip to content
Adam O'Neil edited this page Mar 23, 2020 · 19 revisions

WinForms.Library is a set of helper classes for data binding and using Json-backed document objects with my JsonSettings project. It's also a grab-bag of miscellaneous controls and extensions I reuse across several WinForm apps. I still work with WinForms a fair amount, and I noticed a lot of redundant data binding code, so this library grew out of a need to unify and standardize how I do that. I always felt that off-the-shelf data binding in .NET was too complicated and designer-dependent. A while back I wrote a CodeProject article about this, and this library is an update on that, removing the ORM dependency and simplifying things a bit more.

Classes

Abstract

Controls

  • BuilderTextBox combines an ordinary text box with a button to the right that can display a "builder dialog" to selecting or creating a value in the text box.
  • OpenFileButton for providing a standard way to access a file from a ToolStrip button or menu.
  • WebUrlLinkLabel is a standard LinkLabel setup to visit web URLs.
  • DropDownButton is a regular button control that renders a little dropdown chevron thingy on the right side. When clicked, displays the button's ContextMenuStrip underneath it. I couldn't figure out how to override the text rendering so it offsets correctly for the graphic, but you can work around by adding a few spaces to the end of your text.

Extensions

Interfaces

  • IBoundControl for implementing your own user controls with ControlBinder.

Models