CircleAnglePicker Control — a simple way to pick angles in Windows Forms projects

Meet Aleksey
3 min readFeb 4, 2018

When developing graphic applications, it sometimes becomes necessary to provide the user with an interface for pick the tilt angle. In Windows Forms, for this purpose, we can use the NumericUpDown control or, at worst, a TextBox control or even a TrackBar. But it’s not convenient.

In Photoshop interface, you can find a pretty handy component for adjusting the tilt angles. This is really visual and convenient. I made a similar control for Windows Forms projects.

The control is a circle with a line going from the center. The angle is selected by moving the line in the circle.

CircleAnglePicker — is a free user control written in C#. The source code is open and provided under the terms of the MIT license.

Installation

You can add CircleAnglePicker to your project in two ways.

1. Using the NuGet Package Manager (recommended).

Run the following command in the Package Manager Console:

Install-Package CircleAnglePicker

Or using the graphical interface of NuGet Packages:

2. Manually add a reference to the assembly. To do this, download and unpack the latest release of CircleAnglePicker.

Use the menu Project => Add Reference. In the window that appears, go to the Browse tab and find the CircleAnglePicker.dll file of the same version of the .NET Framework as in your project.

NOTE: This method can be convenient for older versions of Visual Studio (2010 and earlier). If possible, it is better to use the first installation method, using NuGet.

Usage

CircleAnglePicker control is very easy to use.

Place the CircleAnglePicker control on the form.

NOTE: If for some reason you can not find the CircleAnglePicker control in the Toolbox panel, right-click on the Toolbox, select the “Choise Items…” menu and in the window that appears, browse and select the CircleAnglePicker.dll file.

All property values of the control instance placed on the form can be left by default.

The main property is Value. When the value of the Value property changes, a ValueChanged event occurs. You can create a handler for this event by simply double clicking on the CircleAnglePicker control instance on the form.

You can place an instance of NumericUpDown on the form and use it with CircleAnglePicker, as shown in the following example:

https://pastebin.com/D9vdAnK3

If desired, you can customize the appearance of CircleAnglePicker control.

Enjoy!

--

--