Solved

Increase THICKNESS of a Scrollbar

Posted on 2003-10-23
2
537 Views
Last Modified: 2013-11-20
Hi,
 I'm writting an application which interfaces on a touch-screen.  Thus the buttons need to be big, etc, so that people can easily activate them with their fingers.  Using MFC I have a CListCtrl box which is larger than it's dlg, so naturally it has (both vertical and hor.) scrollbars.  However these are cubersome when using your fingers, so I'm trying to make them thicker.  Not just the thumb pad, but the whole bar must present a larger area.  (ie take a 2x8 bar, i need a 4x8 bar).  I'm using Visual studio, C++, MFC and the generic scrollbar (I didn't do any wrappers or anything special, just a regular CListCtrl with scroll option turned on...)  Please let me know how to get that bar thicker.  
  Thanks!
  -John
0
Comment
Question by:jkatebin
2 Comments
 
LVL 4

Accepted Solution

by:
r2far earned 50 total points
ID: 9617179
I am unsure whether you can make the bar within the CListBox bigger, but if you can it will likely envolve making your own derived class.

I don't know if it is a viable option here, but you could create static scrollbars next to the list box, make them what ever size you want, then override the HScroll and VScroll messages to scroll the list box that way.

Here is a sample that should work for vertical scrolling (code goes in OnVScroll():

if( (nSBCode==SB_LINEDOWN) | (nSBCode==SB_PAGEDOWN) )
       pScrollBar->SetScrollPos(pScrollBar->GetScrollPos() + 1);
else if( (nSBCode==SB_LINEUP) | (nSBCode==SB_PAGEUP) )
       pScrollBar->SetScrollPos(pScrollBar->GetScrollPos() - 1);
m_ctlListBox.SetTopIndex(pScrollBar->GetScrollPos());

where pScrollBar is a pointer to the scrollbar sending the VScroll message, and m_ctlListBox is the CListBox.

It is an option that should work.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now