History Edit Control
This sample was contributed by Ravi Bhavnani.
CHistoryEdit is a CEdit derived control that lets you to display a scrolling text history, much like Dev Studio's "Output" window during a compilation. Here's an example of the control (the "History" window) being used in a dialog box.
CHistoryEdit's AppendString() method appends a text string to the control and automatically scroll the most recent entry into view. Two other methods, AllowSelection() and IsSelectable() allow you to control whether the user may select text in the control.
Using CHistoryEdit in a dialog is quite simple:
- Include CHistoryEdit.h in your dialog class' header file.
- Add member variables of type CHistoryEdit for every edit control
you want to subclass.
- Subclass the edit controls in your dialog's OnInitDialog() method.
m_HistoryEdit.SubclassDlgItem (EDIT_HISTORY, this);
- Append text to the control by using AppendString().
m_HistoryEdit.AppendString ("Compiling D:\\XDA\\Test\\Mechanic.kb...");
Download source files (2 K) CHistoryEdit.cpp, CHistoryEdit.h
Download demo project (14 K) (includes sources)
Last updated: 11 April 1998

Comments
How many lines can this control display?
Posted by Legacy on 09/28/2003 12:00amOriginally posted by: dann
How many lines can this control display?
Reply
Easier Win32 Method with 6 lines of code.
Posted by Legacy on 08/02/2003 12:00amOriginally posted by: Sean
ReplyOne question (read)
Posted by Legacy on 10/05/2002 12:00amOriginally posted by: icewolf
How can I check if the vertical scrollbar is at bottom? I only want it to auto scroll down if the scrollbar is on bottom. (like in mIRC)
Thanks.
ReplyThanks a lot
Posted by Legacy on 05/28/2002 12:00amOriginally posted by: sangjin
Thanks...
This Class is exactly the one I really needed!
Replyits more trouble than its worth?
Posted by Legacy on 04/24/2002 12:00amOriginally posted by: jon
i cant believe how much trouble this simple little
box has given me! its so simple but why doesnt it work?
my latest problem is when i restore the window (after being minimized) it blows up. this is only one of the several issues with it...
sigh..
ReplyExEditors Library
Posted by Legacy on 03/19/2002 12:00amOriginally posted by: Mike Philips
ReplyAddString() for CEdit
Posted by Legacy on 12/15/2001 12:00amOriginally posted by: Kim Ji Hoon
Reply
Take a look at this one...
Posted by Legacy on 12/02/2001 12:00amOriginally posted by: Decisoft
... it converts ALL edit controls to drop-downs with history: http://www.decisoft.com
Reply'ReplaceSel' without scrolling?
Posted by Legacy on 02/20/2001 12:00amOriginally posted by: Tony Smith
Can anyone help me?
ReplyIs is possible to disable the scroll functionality in the CEdit::ReplaceSel(..) function in the same way the CEdit::SetSel(..) functions does.
Another version of the AppendString method
Posted by Legacy on 02/12/2001 12:00amOriginally posted by: Larry Maser
ReplyLoading, Please Wait ...