Joe-Schmoe
Joe-Schmoe

Reputation: 61

Need help adding scroll bar to edit box

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?

Upvotes: 2

Views: 4317

Answers (2)

Shane Powell
Shane Powell

Reputation: 14148

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.

Upvotes: 1

Maggie
Maggie

Reputation: 1547

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

has code you can use to control the scroll bar.

Upvotes: 0

Related Questions