CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Apr 2010
    Location
    Western WA, USA
    Posts
    59

    Strange problem with simple scroll bar

    I have a dialog that contains a scroll bar (SB_CTL) that doesn't give the expected behavior. The first clue is that the size of the thumb button is wrong (too large) for the range/page proportions.

    It is initialized to a range of 0 to 112, with a page size of 48.
    Code:
    	vsi.nMin = 0;
    	vsi.nMax = 112;
    	vsi.nPage = 48;
    	vsi.nPos = 0;
    When I grab the thumb, the position will go from 0 to 65, and no higher.
    If click in the 'page down' area, it will go to 96, and no higher.
    If I use the 'line up' and 'line down' buttons, it will go the full range 0 to 112, but the thumb position stops early. If the position is at 112 and I click on the thumb (at the bottom of the bar), the position immediately jumps to 65.

    My experiments have yielded no joy, so I have distilled a minimum length test case, and I hope someone can please tell me why this code isn't working right. Using WinXP-SP3, VC++ 8.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by cosmicvoid; April 6th, 2014 at 02:18 PM. Reason: Add image

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured