简体   繁体   English

Windows API是否具有滚动条控件?

[英]Does Windows API have a scrollbar control?

In Delphi, there is a component called TScrollBox , which allows you to add a scrollbar to a TImage component. 在Delphi中,有一个名为TScrollBox的组件,它允许您向TImage组件添加滚动条。

I need to add a scrollbar to an image in pure Windows API. 我需要在纯Windows API中向图像添加滚动条。 So does Windows API have such a control? Windows API有这样的控件吗? All I found is this 1993 article ! 我发现的只是这1993年的文章

If not, then how can I add a scrollbar to my image? 如果不是,那么如何向图像添加滚动条?

The Windows API provides two types of scrollbars : Windows API提供了两种类型的滚动条

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 . 另一个连接到具有WS_HSCROLL和/或WS_VSCROLL 窗口样式的窗口 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. 操纵非客户滚动条,通过一起包含窗口的窗口句柄与SB_HORZSB_VERT作为nBar参数到适当的滚动条的功能。


Most complete guide to scrollbars (from The Old New Thing ): 滚动条的最完整指南(来自The Old New Thing ):

是的,Win32定义了滚动条类,在此处记录: https : //msdn.microsoft.com/zh-cn/library/windows/desktop/bb787529.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM