Resources » Code Snippets » Application windows, menus & toolbars

Gauge, Speedometer or Dashboard Control Implementation


Posted Date: 09-May-2010  Last Updated:   Category: Application windows, menus & toolbars    
Author: Member Level: Gold    Points: 3


This dashboard control is displays the details like speedometer. Today most of the project wants to make this type of chart. The speedometer needle changes based on the specified value in float.



This dashboard control is displays the details like speedometer.
Today most of the project wants to make this type of chart. The speedometer needle changes based on the specified value in float.

We need the drawing class to implement this control.

Steps:

1) Make the class with the name of Dashboardview inherited from the control class.

2) Add the ToolboxBitmapAttribute, Defaultevent, Description. The default event is fire when the value is change.

3) Create an enumeration for set of needle colors.

4) Declare the needed variables for drawing the ranges, caps based on the maximum and minimum value of the dashboard.

5) Declare the needed variables for arc color, cap color and scale line of the dashboard.

6) Create a subclass for ValueInRangeChangedEventArgs inherited from the Eventargs. This class is mainly used for change the value of the needle. Based on that value the needle display in the dashboard view.

7) We need to override the OnPaint and OnPaintBackground method for draw the
dashboard view.

8) We can also apply the image without drawing the scale and lines.

9) Graphics and Graphicspath is mainly used for draw the lines and range based
on the given input of the range values.

10) This dashboard view is each and every time it redraws or re-paints so it
can reduce the complexity of your application.

11) Change the properties what you need. It is easily used to any application with any requirements of ranges

12) If you want to display the dahsboard view with your own image then you comment some codes. Please see the instruction in the dashboardcontrol.cs file.

Here i attached the sample application Please dowload and send your feedbacks.
Related Resources:


Read related articles: Speedometer    Gauge    Dashboard    Dashboard view    Google Dashboard    

Did you like this resource? Share it with your friends and show your love!

Responses to "Gauge, Speedometer or Dashboard Control Implementation"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Phagu Mahato
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India