Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Enhanced Progress Bar Control

, 11 Jun 2002
An enhanced progress control that supports gradient shading, formatted text, animation, tooltips, shape, 'snake' and reverse modes, and vertical modes
progressctrlx_demo.zip
ProgressBarTest
res
ProgressBarTest.dsp
Release
ProgressBarTest.exe
ProgressBarTest.dsw
pattern.bmp
ShapeHorz.bmp
ShapeVert.bmp
ProgressBarTest.ico
progressctrlx_src.zip
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#include ""PrjVer.h""\r\n"
    "#include ""UIBitsVer.rc2""\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 65
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ProgressBar"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
    ICON            IDR_MAINFRAME,IDC_STATIC,11,22,21,20
    LTEXT           "Enhanced Progress Bar Demo",IDC_STC_NAME,40,10,96,8,
                    SS_NOPREFIX
    LTEXT           "Copyright (C) Yury Goltsman",IDC_STC_COPYRIGHT,40,36,
                    188,8
    LTEXT           "mailto: ygprg@go.to",IDC_MAILTO,40,50,70,8
    LTEXT           "http://go.to/ygprg",IDC_WEBSITE,130,50,66,8
    LTEXT           "Version",IDC_STC_VERSION,40,23,111,8
END

IDD_PROGRESSBARTEST_DIALOG DIALOGEX 0, 0, 335, 260
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Enhanced ProgressBar (best performance in TrueColor mode 24/32 bit)"

FONT 8, "MS Sans Serif"
BEGIN
    PUSHBUTTON      "Run",IDC_RUN,113,239,38,14
    PUSHBUTTON      "Reset",IDC_RESET,227,239,38,14
    PUSHBUTTON      "Close",IDCANCEL,278,239,50,14
    PUSHBUTTON      "Step",IDC_STEP,56,239,38,14
    GROUPBOX        "                                  ",IDC_STATIC,56,7,81,
                    102,WS_GROUP
    CONTROL         "Text",IDC_RADIO_TEXT,"Button",BS_AUTORADIOBUTTON | 
                    WS_GROUP | WS_TABSTOP,63,7,27,8
    CONTROL         "ToolTip",IDC_RADIO_TOOLTIP,"Button",BS_AUTORADIOBUTTON,
                    92,7,37,8
    CONTROL         "No text",IDC_RADIO_NOTEXT,"Button",BS_AUTORADIOBUTTON | 
                    WS_GROUP,62,19,39,10
    CONTROL         "Percent",IDC_RADIO_PERCENT,"Button",BS_AUTORADIOBUTTON,
                    62,31,41,10
    CONTROL         "Position",IDC_RADIO_POS,"Button",BS_AUTORADIOBUTTON,62,
                    43,41,10
    CONTROL         "Percent && Text",IDC_RADIO_PERCENT_F,"Button",
                    BS_AUTORADIOBUTTON,62,55,63,10
    CONTROL         "Position && Text",IDC_RADIO_POS_F,"Button",
                    BS_AUTORADIOBUTTON,62,67,63,10
    CONTROL         "Text Only",IDC_RADIO_TEXTONLY,"Button",
                    BS_AUTORADIOBUTTON,62,79,46,10
    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ | WS_GROUP,57,90,82,
                    1
    CONTROL         "Tied Text",IDC_CHECK_TIEDTEXT,"Button",BS_AUTOCHECKBOX | 
                    WS_GROUP | WS_TABSTOP,62,95,46,10
    GROUPBOX        "Text Align",IDC_STATIC,141,7,48,102
    CONTROL         "Left",IDC_RADIO_LEFT,"Button",BS_AUTORADIOBUTTON | 
                    WS_GROUP,146,19,41,10
    CONTROL         "Right",IDC_RADIO_RIGHT,"Button",BS_AUTORADIOBUTTON,146,
                    32,41,10
    CONTROL         "Center",IDC_RADIO_CENTER,"Button",BS_AUTORADIOBUTTON,
                    146,45,41,10
    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ | WS_GROUP,142,60,
                    48,1
    CONTROL         "Top",IDC_RADIO_TOP,"Button",BS_AUTORADIOBUTTON | 
                    WS_GROUP,146,67,41,10
    CONTROL         "Bottom",IDC_RADIO_BOTTOM,"Button",BS_AUTORADIOBUTTON,
                    146,80,41,10
    CONTROL         "VCenter",IDC_RADIO_VCENTER,"Button",BS_AUTORADIOBUTTON,
                    146,93,41,10
    GROUPBOX        "Bar Settings",IDC_STATIC,193,7,71,102,WS_GROUP
    CONTROL         "Progress",IDC_RADIO_PROGRESS,"Button",
                    BS_AUTORADIOBUTTON | WS_GROUP,202,18,43,10
    CONTROL         "Snake",IDC_RADIO_SNAKE,"Button",BS_AUTORADIOBUTTON,202,
                    29,37,10
    CONTROL         "Rubber Bar",IDC_CHECK_RUBBERBAR,"Button",
                    BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,202,40,52,10
    PUSHBUTTON      "Reverse",IDC_REVERSE,202,51,50,14
    LTEXT           "Border:",IDC_STATIC,202,69,24,8
    EDITTEXT        IDC_EDIT_BORDER,231,68,25,12,ES_NUMBER
    CONTROL         "Fill with brush",IDC_CHECK_BRUSH,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,202,83,58,10
    CONTROL         "Shaped",IDC_CHECK_SHAPE,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,202,94,41,10
    GROUPBOX        "Color Settings",IDC_STATIC,56,112,209,73
    PUSHBUTTON      "Text On Bar",IDC_CLR_TEXT_BAR,104,123,50,14
    PUSHBUTTON      "Text On Bk",IDC_CLR_TEXT_BK,165,123,50,14
    PUSHBUTTON      "Start",IDC_CLR_START,71,140,50,14
    PUSHBUTTON      "Backgnd",IDC_CLR_BK,134,140,50,14
    PUSHBUTTON      "End",IDC_CLR_END,197,140,50,14
    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,57,163,210,1
    LTEXT           "256 colors mode only ",IDC_STATIC,61,159,70,8
    CONTROL         "Use Palette",IDC_CHECK_PALETTE,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,63,170,53,10
    CONTROL         "Skip Palette in Background",IDC_CHECK_SKIP_PAL_BKGND,
                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,135,170,102,10
    CONTROL         "Progress1",IDC_PROGRESS_H,"msctls_progress32",WS_BORDER,
                    56,192,209,14
    LTEXT           "Range:",IDC_STATIC,56,217,24,8
    EDITTEXT        IDC_RANGE,82,214,21,14,ES_NUMBER
    LTEXT           "Step:",IDC_STATIC,109,217,18,8
    EDITTEXT        IDC_STEPSIZE,129,214,21,14,ES_NUMBER
    LTEXT           "Snake Tail :",IDC_STATIC,155,213,24,17
    EDITTEXT        IDC_TAIL,181,214,21,14,ES_NUMBER
    PUSHBUTTON      "Multi Color Gradient",IDC_BUTTON_MULTICOLOR,278,18,50,
                    25,BS_MULTILINE
    PUSHBUTTON      "Old Microsoft Setup Style",IDC_BUTTON_MSSETUP,278,80,50,
                    25,BS_MULTILINE
    PUSHBUTTON      "NetScape Snake",IDC_BUTTON_NS_SNAKE,278,111,50,25,
                    BS_MULTILINE
    CONTROL         "Progress1",IDC_PROGRESS_V,"msctls_progress32",
                    PBS_VERTICAL,7,45,36,208
    PUSHBUTTON      "Centered Gradient",IDC_BUTTON_MULTICOLOR_CENTERED,278,
                    49,50,25,BS_MULTILINE
    PUSHBUTTON      "Another Snake",IDC_BUTTON_MY_SNAKE,278,142,50,25,
                    BS_MULTILINE
    COMBOBOX        IDC_COMBO_TEXT_ANGEL,7,19,36,76,CBS_DROPDOWN | 
                    WS_VSCROLL | WS_TABSTOP
    LTEXT           "Text angle:",IDC_STATIC,7,7,36,10
    PUSHBUTTON      "Font",IDC_BTN_FONT,109,94,22,11
    LTEXT           "Animation Step :",IDC_STATIC,208,213,31,17
    EDITTEXT        IDC_ANIM_STEP,243,214,21,14
    PUSHBUTTON      "Animate",IDC_ANIMATE,170,239,38,14
    PUSHBUTTON      "WinStart Animation",IDC_BUTTON_MS_ANIMATED,278,173,50,
                    25,BS_MULTILINE
    PUSHBUTTON      "Shaped Animation",IDC_BUTTON_SHAPED_ANIMATION,278,204,
                    50,25,BS_MULTILINE
    LTEXT           "Samples:",IDC_STATIC,278,7,50,8
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 228
        TOPMARGIN, 7
        BOTTOMMARGIN, 58
    END

    IDD_PROGRESSBARTEST_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 328
        TOPMARGIN, 7
        BOTTOMMARGIN, 253
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\ProgressBarTest.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDB_PATTERN             BITMAP  DISCARDABLE     "res\\pattern.bmp"
IDB_SHAPE_HORZ          BITMAP  DISCARDABLE     "res\\ShapeHorz.bmp"
IDB_SHAPE_VERT          BITMAP  DISCARDABLE     "res\\ShapeVert.bmp"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//

IDD_PROGRESSBARTEST_DIALOG DLGINIT
BEGIN
    IDC_COMBO_TEXT_ANGEL, 0x403, 2, 0
0x0030, 
    IDC_COMBO_TEXT_ANGEL, 0x403, 3, 0
0x3039, "\000" 
    IDC_COMBO_TEXT_ANGEL, 0x403, 4, 0
0x3831, 0x0030, 
    IDC_COMBO_TEXT_ANGEL, 0x403, 4, 0
0x3732, 0x0030, 
    0
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_ABOUTBOX            "&About ProgressBarTest..."
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc"         // Standard components
#include "PrjVer.h"
#include "UIBitsVer.rc2"
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

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)

Share

About the Author

Yury Goltsman
Software Developer (Senior)
Israel Israel
Yury is Software Engineer since 1988.
His programming experience includes C#/VB.NET, WPF, C/C++(MFC/STL), Borland Delphi & C++ (VCL), JavaScript, HTML, CSS, XML, SQL, VB6, DirectX, Flash.
He has worked on PCs (DOS/Win3.1-Vista) and PocketPCs (WinCE).
 
Yury was born in Ukraine, but currently based in Jerusalem.

| Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 12 Jun 2002
Article Copyright 2001 by Yury Goltsman
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid