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
Solved

Increase THICKNESS of a Scrollbar

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 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