Does Windows API have a scrollbar control?

后端 未结 2 460
一生所求
一生所求 2021-01-03 17:11

In Delphi, there is a component called TScrollBox, which allows you to add a scrollbar to a TImage component.

I need to add a scrollbar to

相关标签:
2条回答
  • 2021-01-03 17:23

    Yes, Win32 defines a scroll bar class, documented here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb787529.aspx

    0 讨论(0)
  • 2021-01-03 17:25

    The Windows API provides two types of scrollbars:

    One is the standalone Scroll Bar control, that comes with its own window handle.

    The other is attached to a window that has the WS_HSCROLL and/or WS_VSCROLL Window Styles. The latter is a nonclient scrollbar and not a control. Consequently it doesn't have a window handle. To manipulate a nonclient scrollbar, pass the window handle of the containing window together with the SB_HORZ or SB_VERT as the nBar parameter to the appropriate scrollbar functions.


    Most complete guide to scrollbars (from The Old New Thing):

    • The scratch program
    • Scrollbars, part 2
    • Scrollbars, part 3: Optimizing the paint cycle
    • Scrollbars, part 4: Adding a proportional scrollbar (Answer to exercise)
    • Keyboard accessibility for scrollbars
    • Scrollbars bart 6 - The wheel
    • Scrollbars part 7 - Integrality
    • Scrollbars part 8 - Integral interactive resizing (Answer to exercise)
    • Scrollbars part 9 - Maintaining the metaphor
    • Scrollbars part 10 - Towards a deeper understanding of the WM_NCCALCSIZE message (Answers to exercises)
    • Scrollbars part 11: Towards an even deeper understanding of the WM_NCCALCSIZE message (Answers to exercise)
    • Scrollbars part 12: Applying WM_NCCALCSIZE to our scrollbar sample
    • Scrollbars redux: Part 12
    0 讨论(0)
提交回复
热议问题