⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0509001.htm

📁 VC知识库5_chm_decompile_20040520_210715
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<link rel="stylesheet" type="text/css" href="../../vckbase.css">
</head>

<body>

<div align="justify">
  <table border="0" width="100%" class="font" height="57">
    <tr>
      <td width="27%" height="6" class="bigfont" bgcolor="#B8CFE7" align="center" bordercolor="#800080">
      <font color="#800080">VC知识库(五)</font>
      </td>
      <td width="73%" height="6" class="bigfont" bgcolor="#B8CFE7" align="center" bordercolor="#800080">
      <font color="#800080">www.vckbase.com</font>
      </td>
    </tr>
    <tr>
      <td width="100%" height="4" class="header" valign="top" align="center" colspan="2">
      <hr>
      </td>
    </tr>
    <tr>
      <td width="100%" height="17" class="header" valign="top" align="center" colspan="2">
      <font COLOR="#AOAO99">在TreeList中使用Edit功能</font>
      </td>
    </tr>
    <tr>
      <td width="100%" height="17" class="info" align="center" colspan="2">
      <a href="mailto:wyy_cq@188.net">闻怡洋</a>翻译 <a href="http://vchelp.yeah.net">http://vchelp.yeah.net</a>
      </td>  
    </tr>  
    <tr> 
      <td width="100%" height="22" class="font" colspan="2">
        <hr>
      </td>  
    </tr> 
    <tr> 
      <td width="100%" height="5" class="font" colspan="2"> 



<p>首先了讲该TreeList应该使用TVS_EDITLABELS风格,可以在创建资源时指定,或者在使用Create时指定,或者在PreCreateWindos()中改变。 

</p>



<p>接下来需要处理TVN_BEGINLABELEDIT和TVN_ENDLABELEDIT消息。&nbsp; </p>



<pre><tt><font COLOR="#990000">void CXXXX::OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult)&nbsp;
{

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Limit text length

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetEditControl()-&gt;LimitText(127);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pResult = 0;
}</font></tt></pre>



<p>如果不处理 TVN_ENDLABELEDIT 消息,则文本的更改不会生效。<br> 
 
&nbsp;<tt><font COLOR="#990000">void COutline::OnEndLabelEdit(NMHDR* pNMHDR, LRESULT*  
 
pResult)&nbsp;<br> 
 
{<br> 
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetEditControl()-&gt;GetWindowText(s);<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Set result to TRUE to accept the changes<br> 
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *pResult = TRUE;<br> 
 
}</font></tt></p> 
 
 
 
      </td>     
    </tr>    
    <tr> 
      <td width="100%" height="12" class="font" colspan="2">  
      </td>     
    </tr> 
    <tr> 
      <td width="100%" height="6" class="font" colspan="2">  
      </td>     
    </tr> 
    <tr> 
      <td width="100%" height="8" class="font" colspan="2">  
      </td>     
    </tr> 
    <tr>    
      <td width="100%" height="17" class="font" colspan="2"></td>     
    </tr>    
  </table>     
</div>     
     
</body>     
     
</html>     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -