Solved

Increase THICKNESS of a Scrollbar

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

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

630 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