views:

261

answers:

2

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?

A: 

http://www.functionx.com/visualc/controls/scrollbar.htm

has code you can use to control the scroll bar.

Maggie
A: 

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.

With MFC you use the "CWnd::ShowScrollBar" method to turn the scroll bar on/off.

When scrollbars are turned on, then they should work automatically for edit controls. You don't need to do anything.

Shane Powell