I'm making an MFC dialog-based application in Visual C++ 2005. I added a scroll bar to an edit box. How do I program the scroll bar to make it work?
我在Visual C ++ 2005中创建了一个基于MFC对话框的应用程序。我在编辑框中添加了一个滚动条。如何编程滚动条使其工作?
2 个解决方案
#1
The windows styles wS_VSCROLL and WS_HSCROLL control if there is a scroll bar present or not. Normally you just setup these styles as part of the resource dialog template.
如果存在滚动条,则窗口样式为wS_VSCROLL和WS_HSCROLL控制。通常,您只需将这些样式设置为资源对话框模板的一部分。
With MFC you use the "CWnd::ShowScrollBar" method to turn the scroll bar on/off.
使用MFC,您可以使用“CWnd :: ShowScrollBar”方法打开/关闭滚动条。
When scrollbars are turned on, then they should work automatically for edit controls. You don't need to do anything.
当滚动条打开时,它们应自动用于编辑控件。你不需要做任何事情。
#2
http://www.functionx.com/visualc/controls/scrollbar.htm
has code you can use to control the scroll bar.
有代码可以用来控制滚动条。
#1
The windows styles wS_VSCROLL and WS_HSCROLL control if there is a scroll bar present or not. Normally you just setup these styles as part of the resource dialog template.
如果存在滚动条,则窗口样式为wS_VSCROLL和WS_HSCROLL控制。通常,您只需将这些样式设置为资源对话框模板的一部分。
With MFC you use the "CWnd::ShowScrollBar" method to turn the scroll bar on/off.
使用MFC,您可以使用“CWnd :: ShowScrollBar”方法打开/关闭滚动条。
When scrollbars are turned on, then they should work automatically for edit controls. You don't need to do anything.
当滚动条打开时,它们应自动用于编辑控件。你不需要做任何事情。
#2
http://www.functionx.com/visualc/controls/scrollbar.htm
has code you can use to control the scroll bar.
有代码可以用来控制滚动条。