📄 subject_50604.htm
字号:
<p>
序号:50604 发表者:wangqian 发表日期:2003-08-25 09:22:22
<br>主题:CTreeCtrl 中的GetItemState()的返回值,是什么意思
<br>内容:CTreeCtrl 中的GetItemState()的返回值,是什么意思 <BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:3SForum 回复日期:2003-08-25 09:47:10
<br>内容:Return Value<BR>Nonzero if it is successful; otherwise, it is zero.<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:iamhere 回复日期:2003-08-25 09:47:55
<br>内容:返回的是Item的状态,状态的具体取值和含义请参见MSDN中TVITEM结构中的state字段
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:wangqian 回复日期:2003-08-25 09:55:20
<br>内容:状态的具体取值和含义请参见MSDN中TVITEM结构中的state字段 !!!!!!!!!!!!!!<BR>我就是不懂这一点啊!!!!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:iamhere 回复日期:2003-08-25 10:35:16
<br>内容:天啊,那么一段英文,你不会要我完整的翻译给你吧?!<BR>简单的说:这个state中不同的bit位具有不同的含义,具体返回哪些bit是由GetItemState中的第二个参数nStateMask决定的,请看下面的例子:<BR><BR>// The pointer to my tree control.<BR>extern CTreeCtrl* pmyTreeCtrl;<BR><BR>// Show all of the visible items in bold.<BR>HTREEITEM hItem = pmyTreeCtrl->GetFirstVisibleItem();<BR><BR>while (hItem != NULL)<BR>{<BR> pmyTreeCtrl->SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);<BR> ASSERT(pmyTreeCtrl->GetItemState(hItem, TVIS_BOLD) == TVIS_BOLD);<BR> hItem = pmyTreeCtrl->GetNextVisibleItem(hItem);<BR>}<BR><BR><BR>其中调用GetItemState时传入的第二个参数nStateMask为TVIS_BOLD,那么返回值就是MSDN中关于state说明中的第0-7个bit对应的取值:<BR>Bits 0 through 7 of this member contain the item state flags. For a list of possible item state flags, see Tree-View Control Item States.<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -