CEdit *edit; edit = (CEdit*)GetDlgItem(IDC_EDIT1); if (edit != NULL) { edit->LineScroll(edit->GetLineCount()); }