Solved

Increase THICKNESS of a Scrollbar

Posted on 2003-10-23
2
665 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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