Click here to Skip to main content
11,496,146 members (1,612 online)
Click here to Skip to main content

3D Thermometer Control

, 2 Feb 2007 54K 2.1K 40
3D Thermometer Control Drawn with GDI Plus
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.

Sample Image - maximum width is 600 pixels


Drop-in MFC class to display temperature


I had the need to display temperature readings from sensors. After taking apart a couple of very nice controls written by Davide Calabro I decided to try and show off.


This project was built and tested on Windows XP using Visual Studio 2003 SP1

Using the code

  1. Add GDI+ support to your application: Starting with GDI+
  2. Add TempCtrl.h and TempCtrl.cpp to your project.
  3. Include TempCtrl.h in your main window/form view class.
  4. Create a member variable of type CTempCtrl.
  5. In the window initialization, subclass the thermometer:
    BOOL int CMainDlg::OnInitDialog()
        // ...
        // Setup thermometer control
        m_TempCtrl.SubclassDlgItem(IDC_TEMP, this);
        // ...


Very special thanks to Davide Calabro for his knob and cylinder progress controls:


The control's size currently has to be within a certain range to be look right. In the future I will dynamically set line widths, font sizes, etc from the control size.


Jan 31st 2007 - Original Article.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer
United States United States
No Biography provided

Comments and Discussions

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150520.1 | Last Updated 2 Feb 2007
Article Copyright 2007 by JJMatthews
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid