难道Windows API的有一个滚动条控制? [英] Does Windows API have a scrollbar control?
问题描述
在Delphi中,有一个叫 TScrollBox
组件,它允许您将滚动条添加到的TImage
组件
In Delp there is a component called TScrollBox
, which allows you to add a scrollbar to a TImage
component.
我需要一个滚动条纯粹的Windows API添加到图像。因此,没有Windows API的有这样的控制?所有我发现这是 1993年的文章!
I need to add a scrollbar to an image in pure Windows API. So does Windows API have such a control? All I found is this 1993 article!
如果没有,那么我怎么能一个滚动条添加到我的形象?
If not, then how can I add a scrollbar to my image?
推荐答案
在Windows API提供的两种滚动条的:
The Windows API provides two types of scrollbars:
一个是独立的滚动条控制,随自己的窗口句柄。
One is the standalone Scroll Bar control, that comes with its own window handle.
另一个连接到具有 WS_HSCROLL
和/或 WS_VSCROLL
的窗口样式的。后者是一个非工作滚动条,而不是控制。因此它不具有一个窗口句柄。操纵非客户滚动条,用 SB_HORZ
或 SB_VERT
一起传递包含窗口的窗口句柄作为 NBAR
的参数,以适当的滚动条功能。
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.
最完整的指南,滚动条(从旧的新):
- 划痕计划
- 滚动条,第2部分
- 滚动条,第3部分:优化油漆周期
- 滚动条,第4部分:添加比例滚动条(答行使)
- 键盘辅助的滚动条
- 滚动条BART 6 - 车轮
- 滚动条部分7 - 完整性
- 滚动条第8部分 - 整体互动调整大小(答行使)
- 滚动条的一部分9 - 维护比喻
- 滚动条部分10 - 迈向的更深入的了解WM_NCCALCSIZE消息(习题答案)
- 滚动条第11部分:迈向一个更深刻的理解在WM_NCCALCSIZE消息(答案行使一>)
- 滚动条第12部分:应用WM_NCCALCSIZE我们的滚动条样本
- 滚动条终极版:第一部分12
- 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
这篇关于难道Windows API的有一个滚动条控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!