MFC关于Tree Control的使用

1、TreeControl中InsertItem中有的有3个参数,有的有5个参数,3个参数的第3个参数InsertedAfter有什么用,5个参数中有2个图标,有什么区别... 1、Tree Control中InsertItem中有的有3个参数,有的有5个参数,3个参数的第3个参数InsertedAfter有什么用,5个参数中有2个图标,有什么区别

2、使用GetSelectedItem获得HTREEITEM后使用DeleteItem为什么所有的项都被删除了?

3、Tree Control还有哪些常用函数,比如如何展开一项,收起一项,等等..
问题2和3呢
展开
 我来答
xiaohuh421
2009-12-21 · TA获得超过904个赞
知道小有建树答主
回答量:897
采纳率:0%
帮助的人:377万
展开全部
下个MSDN吧,有中文版的,英文版的.没有MSDN寸步难行啊..
以下是摘自MSDN
CTreeCtrl::InsertItem
HTREEITEM InsertItem( LPTVINSERTSTRUCT lpInsertStruct );

HTREEITEM InsertItem(UINT nMask, LPCTSTR lpszItem, int nImage, int nSelectedImage, UINT nState, UINT nStateMask, LPARAM lParam, HTREEITEM hParent, HTREEITEM hInsertAfter );

HTREEITEM InsertItem( LPCTSTR lpszItem, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST );

HTREEITEM InsertItem( LPCTSTR lpszItem, int nImage, int nSelectedImage, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST);

Return Value

Handle of the new item if successful; otherwise NULL.

Parameters

lpInsertStruct

A pointer to aTVINSERTSTRUCT that specifies the attributes of the tree view item to be inserted.

nMask

Integer specifying which attributes to set. See theTVITEM structure in the Platform SDK.

lpszItem

Address of a string containing the item’s text.

nImage

Index of the item’s image in the tree view control’s image list.

nSelectedImage

Index of the item’s selected image in the tree view control’s image list.

nState

Specifies values for the item’s states. SeeTree View Control Item States in the Platform SDK for a list of appropriate states.

nStateMask

Specifies which states are to be set. See theTVITEM structure in the Platform SDK.

lParam

A 32-bit application-specific value associated with the item.

hParent

Handle of the inserted item’s parent.

hInsertAfter

Handle of the item after which the new item is to be inserted.

Remarks

Call this function to insert a new item in a tree view control.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式