我已经重写了鼠标双击事件。但是通过键盘还是可以把树收缩、展开。请问,我该如何禁止键盘收缩、展开树节点呢?谢谢。

解决方案 »

  1.   

    process keyboard msg in wndproc
      

  2.   

    在键盘响应函数中设定这个:BOOL Expand( HTREEITEM hItem, UINT nCode );Return ValueNonzero if successful; otherwise 0.ParametershItemHandle of the tree item being expanded.nCodeA flag indicating the type of action to be taken. This flag can have one of the following values: TVE_COLLAPSE   Collapses the list.
    TVE_COLLAPSERESET   Collapses the list and removes the child items.
    TVE_EXPAND   Expands the list.
    TVE_TOGGLE   Collapses the list if it is currently expanded or expands it if it is currently collapsed.
      

  3.   

    是不是在PreTranslateMessage里面来拦截键盘消息呢?那键盘上的左键和右键对应的宏是什么?该到哪里查呢?我找了找没找到啊!谢谢各位了!