Click here to Skip to main content
15,891,473 members
Articles / Desktop Programming / MFC

Roll Your Own Scroll Bar

Rate me:
Please Sign up or sign in to vote.
4.92/5 (20 votes)
26 Oct 2010CPOL10 min read 83K   8.6K   56  
XeScrollBar - Custom scroll bar, a replacement for Windows scroll bar
Download UltimateGrid72_src.zip from Codeproject.
Extract to C:\Test

Download UltimateGrid72_Samples.zip from Codeproject.
Extract to C:\Test

Copy xescrollbarbase.h and xescrollbar.h to C:\Test\Ultimate Grid\Include folder.

Copy XeScrollBarBase.cpp, XeScrollBar.cpp and XeScrollBar.rc to C:\Test\Ultimate Grid\Source folder.

Create 'res' folder in C:\Test\Ultimate Grid\Source folder.
Copy the eight bitmap files (XSB_?_???.bmp) into the res folder.

Run Visual Studio.
Open ugmfclib.sln from C:\Test\Ultimate Grid\BuildLib folder.

Add xescrollbarbase.h and xescrollbar.h from C:\Test\Ultimate Grid\Include folder to 'include' section.

Add XeScrollBarBase.cpp, XeScrollBar.cpp and XeScrollBar.rc from C:\Test\Ultimate Grid\Source folder to 'Source' section.

Open ughscrol.h
	Add #include "XeScrollBar.h" at top of file.
	Find 'CScrollBar' and replace all with 'CXeScrollBar'.

Open ugvscrol.h
	Add #include "XeScrollBar.h" at top of file.
	Find 'CScrollBar' and replace all with 'CXeScrollBar'.

Open ughscrol.cpp
	Find 'CScrollBar' and replace all with 'CXeScrollBar'.

Open ugvscrol.cpp
	Find 'CScrollBar' and replace all with 'CXeScrollBar'.

Build solution.

Close solution.

Open AllExamples.sln from C:\Test\Ultimate Grid\Examples\AllExamples

Drag and drop XeScrollBarBase.cpp, XeScrollBar.cpp and XeScrollBar.rc from C:\Test\Ultimate Grid\Source folder to all the projects in the solution. Except 'Use UG DLL' and 'Use UG Lib'.

Now you can build and run any project from the solution that you want.


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
Software Developer (Senior) Kvikna.com
Iceland Iceland
I started programming back in 1980, briefly in Basic, switched to Assembler (Z80 CPU) running CP/M OS. Started to program for MS-DOS in Assembler (8088 CPU) when the IBM PC made it's apperance. Switched to C when I started to write programs for Windows in 1991. In 2002 switched to C++ and MFC. In 2011 started developing in C# .NET for Sharepoint 2010. In 2016 started developing WPF applications.

Comments and Discussions