Click here to Skip to main content
15,881,882 members
Articles / Desktop Programming / MFC

Bar Graph Control

Rate me:
Please Sign up or sign in to vote.
3.63/5 (13 votes)
5 Feb 2007CPOL2 min read 72.8K   3.4K   45  
A useful bar graph control, derived from CStatic.
// MyStatic.cpp : implementation file
//

#include "stdafx.h"
#include "GraphTest.h"
#include "MyStatic.h"
#include ".\mystatic.h"


// CMyStatic

IMPLEMENT_DYNAMIC(CMyStatic, CStatic)
CMyStatic::CMyStatic()
{
	stColor = RGB(0,0,0);
}

CMyStatic::~CMyStatic()
{
}


BEGIN_MESSAGE_MAP(CMyStatic, CStatic)
	ON_WM_PAINT()
END_MESSAGE_MAP()



// CMyStatic message handlers


void CMyStatic::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	// TODO: Add your message handler code here
	// Do not call CStatic::OnPaint() for painting messages
	RECT rc;
	GetClientRect(&rc);
	dc.FillSolidRect(&rc, stColor);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
Mr. Shaibujan has got 9+ yrs of programming experience in C/C++, on various domains like Cryptography, Biometric Security, Network Security, Pattern Recognition, Image Processing, MPEG2, MPEG4, H.264, AAC etc.

Comments and Discussions