难道Windows API的有一个滚动条控制? [英] Does Windows API have a scrollbar control?

查看:905
本文介绍了难道Windows API的有一个滚动条控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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.



最完整的指南,滚动条(从旧的新):

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆