使用滚动条创建窗口时出现问题 [英] Problem with creating a window with scroll bar

查看:115
本文介绍了使用滚动条创建窗口时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在创建带滚动条的窗口时遇到问题,这里我正在创建带滚动条的子窗口,但问题是滚动条处于禁用状态。我们有什么方法可以创建一个滚动条到子窗口。

我们在文档管理系统中,所以我们需要通过创建子窗口在查看器中显示文件(PDF),所以子窗口正在创建问题。

最后我想在Win32中找到解决方案。



我尝试了什么:



CreateWindowEx(0L,Lstatic,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL,0,0,0,0,(HWND)pDataSurface,0, (HINSTANCE)GetWindowLong((HWND)pDataSurface,GWL_USERDATA),0);

Hi ,

i have problem with creating a window with scroll bar, here i am creating child window with scrollbar's but the problem is scrollbar's are in disabling state. is there any way can we able to create a scroll bars to a childwindow.
We are in document management system so we need to show files(PDF) in viewer by creating child windows , so the child window is creating the problem.
Finally I want solution in Win32.

What I have tried:

CreateWindowEx(0L,L"static",NULL,WS_CHILD| WS_VISIBLE | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL ,0,0,0,0,(HWND)pDataSurface,0,(HINSTANCE)GetWindowLong((HWND)pDataSurface,GWL_USERDATA),0);

推荐答案

只有在设置视图大小和数量时,滚动条才会启用要滚动的数据。请参阅 SetScrollInfo功能(Windows) [ ^ ]。
The scrollbars only become enabled when you set the size of the view and the amount of data to be scrolled. See SetScrollInfo function (Windows)[^].


没有滚动条范围和位置的自动设置(除了一些特殊的控制窗口类型)。它必须由您根据窗口中显示的数据实现。



对于观看者,您必须使用 SetScrollInfo从查看内容(例如行数和列数)初始化滚动条范围和位置并实现将根据滚动条动作滚动视图的处理程序。
There is no automatic setting of scroll bar ranges and positions (besides some special control window types). It must be implemented by you according to the data shown in the window.

For a viewer, you have to initialise the scroll bar ranges and positions from the viewing content (e.g. number of rows and columns) using SetScrollInfo and implement handlers that will scroll the view according to the scroll bar actions.


函数 EnableScrollBar 应该可以解决问题。



孩子窗口应该大于带有滚动条的父级,或者滚动条被禁用。
The function EnableScrollBar should solve the problem.

The child window should be greater than the parent with the scrollbars, or the scrollbars getting disabled.


这篇关于使用滚动条创建窗口时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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