📄 history_edit.shtml.htm
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="zafir anjum">
<title>edit controls - table of contents</title>
<meta name="description" content="source code for various windows controls">
<meta name="keywords" content="mfc source code edit controls">
</head>
<body background="../di2001.jpg"
tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#ffffff">
<h3 align="center"><font color="#aoao99">history edit control</font></h3>
<hr>
<p>this sample was contributed by <a href="http://members.xoom.com/ravib"
tppabs="http://members.xoom.com/ravib">ravi bhavnani</a>. </p>
<p>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. </p>
<p><img src="history_edit.gif" tppabs="http://www.codeguru.com/editctrl/history_edit.gif"
border="0" width="282" height="267" alt="chistoryedit demo"> </p>
<p>chistoryedit's <tt><font color="#880000">appendstring()</font></tt> method appends a
text string to the control and automatically scroll the most recent entry into view. two
other methods, <tt><font color="#880000">allowselection()</font></tt> and <tt><font
color="#880000">isselectable()</font></tt> allow you to control whether the user may
select text in the control. </p>
<p>using chistoryedit in a dialog is quite simple:
<ol>
<li>include <tt>chistoryedit.h</tt> in your dialog class' header file. </li>
<li>add member variables of type <tt>chistoryedit</tt> for every edit control you want to
subclass. </li>
<li>subclass the edit controls in your dialog's <tt>oninitdialog()</tt> method. <p><tt><font
color="#880000"> m_historyedit.subclassdlgitem (edit_history, this); </font></tt></p>
</li>
<li>append text to the control by using <tt><font color="#880000">appendstring()</font></tt>.
<p><tt><font color="#880000"> m_historyedit.appendstring ("compiling
d:\\xda\\test\\mechanic.kb..."); </font></tt></p>
</li>
</ol>
<p><a href="history_edit.zip" tppabs="http://www.codeguru.com/editctrl/history_edit.zip">download
source files (2 k)</a> chistoryedit.cpp, chistoryedit.h <br>
<a href="history_edit_demo.zip"
tppabs="http://www.codeguru.com/editctrl/history_edit_demo.zip">download demo project (14
k)</a> (includes sources) <!-- remember to update this --> </p>
<p>last updated: 11 april 1998 </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -