Solved

Increase THICKNESS of a Scrollbar

Posted on 2003-10-23
2
671 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Complete beginner needs help making a cron job 9 129
post4 challenge 28 113
NotAlone Challenge 20 88
unix example issues 18 106
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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…

756 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