Click here to Skip to main content
12,556,659 members (80,964 online)
Click here to Skip to main content
Add your own
alternative version


17 bookmarked

Making Graphical effect from Progress Bar

, 20 Jun 2004
Rate this:
Please Sign up or sign in to vote.
Usage of Progress Bar control.

Sample screenshot


MFC provides the CProgressCtrl class that helps to make the Windows progress bar control. CProgressCtrl is derived directly from Cwnd class and inherits the function of Cwnd class. It can be created as a child control of any window and also you can use from the dialog resource template.

I need the control that shows graphical effect in changing the sound level, so I made this application which is presented to you. I used it in a voice graph application using different voices. Here I used timer to show the graphical effect of progress bar.

Thing Required

  • Microsoft Visual C++ 6.0.
  • Microsoft Windows 9x/2000/XP.


void CGraphProgressView::OnButton1()
    BOOL fRun = FALSE;

        SetTimer(1,85, 0);

    fRun = !fRun;

void CGraphProgressView::DoDataExchange(CDataExchange* pDX)
    DDXControl(pDX, IDC_BUTTON1, btnRun);
    DDX_Control(pDX, IDC_PROGRESS1, m_progress1);
    DDX_Control(pDX, IDC_PROGRESS2, m_progress2);
    DDX_Control(pDX, IDC_PROGRESS3, m_progress3);
    DDX_Control(pDX, IDC_PROGRESS4, m_progress4);
    DDX_Control(pDX, IDC_PROGRESS5, m_progress5);
    DDX_Control(pDX, IDC_PROGRESS6, m_progress6);
    DDX_Control(pDX, IDC_PROGRESS7, m_progress7);
    DDX_Control(pDX, IDC_PROGRESS8, m_progress8);
    DDX_Control(pDX, IDC_PROGRESS9, m_progress9);
    DDX_Control(pDX, IDC_PROGRESS10, m_progress10);
    DDX_Control(pDX, IDC_PROGRESS11, m_progress11);
    DDX_Control(pDX, IDC_PROGRESS12, m_progress12);
    DDX_Control(pDX, IDC_PROGRESS13, m_progress13);
    DDX_Control(pDX, IDC_PROGRESS14, m_progress14);
    DDX_Control(pDX, IDC_PROGRESS15, m_progress15);
    // NOTE: the ClassWizard will add DDX and DDV calls here

Class Methods

I used the two methods of the CProgressCtrl class.

SetStep() It shows the step increment for a progress bar control.

It advances the current position for a progress bar control by the step increment and redraws the bar to show the new position.

Using the MFC AppWizard (exe) application: choose the base class CFormView, to make this application. Try to make it and enjoy.


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

Abdul Hye
Web Developer
Pakistan Pakistan
I did Msc Computer Scicences specialization in software engineering from University of Management and Technology Lahore,and having the experience of IT for more than 5 years.
I have worked in different programming languages, such as: C, C++, Visual C++,Java, Visual Basic and C#, also in PHP, HTML, ASP, ASP.NET and also CCNA & RedHat Linux. Love Mathematics. I have always been fascinated by .NET, so now I am programming in .NET.

You can email me:
Visit my web site:

You may also be interested in...


Comments and Discussions

Questioncan i used it for sound level Pin
Williamt22-Jun-04 3:42
memberWilliamt22-Jun-04 3:42 
AnswerRe: can i used it for sound level Pin
Abdul Hye4-Jul-04 1:35
memberAbdul Hye4-Jul-04 1:35 
Questionhow to use CFormview Pin
Jhon_b21-Jun-04 22:07
memberJhon_b21-Jun-04 22:07 
AnswerRe: how to use CFormview Pin
Abdul Hye4-Jul-04 1:40
memberAbdul Hye4-Jul-04 1:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161026.1 | Last Updated 21 Jun 2004
Article Copyright 2004 by Abdul Hye
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid