CEdit Scrollbar help required

CEdit Scrollbar help required

Post by biegler » Thu, 08 Jan 2004 23:03:25

(I apologize in advance if this is not the right newsgroup.)

I am attempting to write a program that does the following.

Opens up a dialog box with an editbox, checkbox, and button.
Initially, the checkbox and the button are disabled. A file is read
and sent to the edit box. This file contains a disclaimer. I want
the user to scroll all the way down to the of the disclaimer in the
editbox. Once the user has done this, the checkbox is enabled. Once
the checkbox is enabled, the button becomes enabled. Once the button
is pressed the dialog box closes.

The question is:
How do I implement the ability to scroll to the bottom of the
disclaimer in order to continue?


CEdit Scrollbar help required

Post by Ali R » Fri, 09 Jan 2004 10:55:25

Here is what I would do
Derive a class from CEdit and take over WM_VSCROLL, (not EN_VSCROLL)

void CScrollNotifyEdit::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar*
CEdit::OnVScroll(nSBCode, nPos, pScrollBar);

int Max = GetScrollLimit(SB_VERT);
if (GetScrollPos(SB_VERT) == Max)

Ali R.