scrollbars plus a bonus question!

This is a discussion on scrollbars plus a bonus question! within the Windows Programming forums, part of the Platform Specific Boards category; I have two questions. The first is about scroll bars, and scrolling down via the arrow keys. How to a ...

  1. #1
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685

    scrollbars plus a bonus question!

    I have two questions. The first is about scroll bars, and scrolling down via the arrow keys. How to a know if a user moved a scroll bar, and how can I tell the increment in which they moved it?

    My second question is how do I disable the ability to edit an edit control?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    Ae you using MFC, OWL, or WinAPI for the scrollbar?

    A scrollbar will send a WM_VSCROLL or WM_HSCROLL message to its parent window when it scrolls.

    The WinAPI way to get the position of a scrollbar is to send the scrollbar window a SBM_GETPOS message. You may also want to use the SBM_GETRANGE message to get the range of the scrollbar.

    You can disable an edit control just like any other window or control -- use EnableWindow(HWND, BOOL). So, if hWindow is the handle of the edit control, do:

    EnableWindow(hWindow,FALSE);

    to disable it.
    Last edited by The V.; 09-27-2001 at 08:17 PM.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Thanks. I am using the winAPI actually, so you may also be a mind reader

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    412
    Shh, don't tell anybody =]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. bonus question
    By SpEkTrE in forum Linux Programming
    Replies: 1
    Last Post: 12-09-2003, 06:33 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM

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