MFC :: Handling WS_VSCROLL (OnVScroll) ... Please help.

This is a discussion on MFC :: Handling WS_VSCROLL (OnVScroll) ... Please help. within the Windows Programming forums, part of the Platform Specific Boards category; Hello. Thanks for reading my post; hopefuly you can help me out. I am on a Windows 2000 Pro. computer, ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question MFC :: Handling WS_VSCROLL (OnVScroll) ... Please help.

    Hello. Thanks for reading my post; hopefuly you can help me out. I am on a Windows 2000 Pro. computer, and I am using MS Visual C++ 6.0 Standard. I have an application, a level editor I am working on for a game, and it's coming along well. The view class is derived from CView. Everything displays just fine, but I am having a little bit of trouble. I want the user to be able to scroll (horizontally and vertically). I can use the arrow keys to scroll, by calling ScrollWindow(), but I need another way to do this, too. I added the function OnVScroll() to my view class source file, but it doesn't scroll. How would I handle the function to scroll? Also, how would I set the size of the scrollbar so that it only scrolls to a certain point, and can't scroll anymore? I hope you know what I mean. If you can, please provide an answer to my question(s).

    Thanks,
    Matt U.

  2. #2
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    I do not use MFC, but you should handle the scroll messages and make them call the same function that your keyboard handler calls when processing the arrow keys. There is no need to code the same process twice.

    The Win32 API function for setting scroll limitations on scroll bars is the SetScrollInfo Function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC Controls and Thread Safety :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 10:36 AM
  2. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM
  3. Release MFC Programs & Dynamic MFC DLL :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-18-2002, 06:42 PM
  4. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 05:58 PM
  5. MFC is Challenging :: C++
    By kuphryn in forum C++ Programming
    Replies: 8
    Last Post: 02-05-2002, 12:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21