?? range_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">
<!-- article title -->
<h3 align="center"><font color="#aoao99">a range validation edit control </font></h3>
<hr align="center">
<!-- author and contact details -->
<p>this article was contributed by <a href="mailto:drkich@csrlink.net">donald r. kichline</a>.
<!-- sample image and source code/demo project --></p>
<p>download <a href="range_edit_src.zip"
tppabs="http://www.codeguru.com/editctrl/range_edit_src.zip">source code</a> and <a
href="range_edit_demo.zip" tppabs="http://www.codeguru.com/editctrl/range_edit_demo.zip">example</a>
</p>
<p><br>
</p>
<p>in a project that i am working with about 6 people, we were using spin controls and
edit controls to allow the operator to change certain values. we decided we needed one way
to handle invalid data typed in the edit control by the operator. the best solution we
came up with was to sub-class cedit, and validate the operators key-strokes.
<ol>
<li>ensure that the edit control has the number only style set to true. </li>
<li>then you need to include the "crangeedit.h" in your dialog definition file,
and declare crangeedit member variables for each edit control that you need to check the
range of an operators input.</li>
<li>then you must set the range the crangeedit will accept from the operator, using the
crangeedit::setrange() method. the crangeedit will default to 0-100 range. </li>
<li>set the default contents of the control using cwnd::setwindowtext().</li>
</ol>
<p>you should be ready to go!</p>
<!-- remember to update this -->
<p>last updated: 29 april 1998 </p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -