Radial Control | CodeGuru

Radial Control

Environment: Win9x, VC6 SP4 I need a software control to simulate and replace a hardware dial control. So I came up with this control. This radial control is derived from CStatic and can be created using the ClassWizard or you can do your own subclassing. Most of the commands are similar to CSliderCtrl, I may […]

Written By
CodeGuru Staff
CodeGuru Staff
Oct 11, 2000
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Win9x, VC6 SP4

I need a software control to simulate and replace a hardware dial control. So I
came up with this control. This radial control is derived from CStatic
and can be created using the ClassWizard or you can do your own subclassing.

Most of the commands are similar to CSliderCtrl, I may in the future derived
this class from CSliderCtrl and send all slider control messages. Currently
this control only sends the WM_HSCROLL message when being modified
via mouse or keyboard. The reason that the control sends a message is so that
the parent has a chance to act on that message.

There is a difference between the current positon and the current angle. The angle
is the current position in degrees of the arrow. The current position is the current
angle translated into the range that the user has set. For example the current angle
could be 0 degrees, but since the user had set the min/max range to be 100/200
respectively, the current position is 100.

The control also reponses to the ON_WM_SYSCOLORCHANGE message so
that if the user has changed the colors of the system the control will automatically
updates itself.

Downloads

Download demo project and source code – 20 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.