English 中文(简体)
CTreeViewCtrl
原标题:Get Click event for CTreeViewCtrl
  • 时间:2012-01-11 15:08:08
  •  标签:
  • wtl

我指点树情——“和”的元件;它显示在清单中。

我建立了这样的控制(树木和名单——“和”;CTreeViewCtrl和CListViewCtrl)。

    split.Create(*this,rcDefault,NULL,0,WS_EX_CLIENTEDGE);
    RECT rlist,rtree;
    list.Create(split,rlist,CListViewCtrl::GetWndClassName(),WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_REPORT | LVS_EDITLABELS, WS_EX_CLIENTEDGE);
    tree.Create(split,rtree,CTreeViewCtrl::GetWndClassName(),WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_REPORT | TVS_EDITLABELS, WS_EX_CLIENTEDGE);
    list.AddColumn(L"KEY",0);
    list.AddColumn(L"VALUE",1);
    split.SetSplitterPanes(tree,list);

活动将发挥什么样的功能?

最佳回答

电视N_SELCHANGED 通知代码:

Notifies a tree-view control s parent window that the selection has changed from one item to another. This notification code is sent in the form of a WM_NOTIFY message.

也就是说,当你点击某一项目并改变对树木情况控制的选择时,控制发送了<代码>。 WM_NOTIFY 致其母(如你的方言)的密码,你应当处理。

问题回答

页: 1 h

// ...
CTreeViewCtrlEx m_treeview;

// ...
BEGIN_MSG_MAP(CMainFrame)
// ...
NOTIFY_CODE_HANDLER(TVN_SELCHANGED, OnTVSelChanged)
END_MSG_MAP()

以及

// mainfrm.h or mainfrm.cpp
LRESULT CMainFrame::OnTVSelChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
  //...
}




相关问题
Handling wm_mousewheel message in WTL

I am trying to handle wm_mousewheel for my application. Code: BEGIN_MSG_MAP(DxWindow) MESSAGE_HANDLER(WM_MOUSEWHEEL, KeyHandler) END_MSG_MAP() . . . LRESULT DxWindow::KeyHandler( UINT uMsg, ...

WTL Child window event handling

I am developing window application in that I am having 2 child windows on left and right side. I want to handle input events for both windows separately. How to achieve it? My code: class ...

Printing on console WIN32/WTL

I am developing WTL GUI application. I want to print something on console. How to enable console printing in win32/WTL application.

How can I install WTL 8.0 Project Wizards in VS 2010?

I ve downloaded the WTL 8.0 package and come to find the scripts to install App Wizards don t support VS 2010. Does anyone know of updates scripts to support installation in VS 2010? Thank you!

default WM_DESTROY not properly cleaning up child windows

I have a WTL 8.0 SDI application for Windows Mobile 5. In this contrived example below, I create a view, destroy it, then re-create it. But, when it s re-created assertions in the WM_INITDIALOG ...

热门标签