简体   繁体   中英

Button in MFC CtreeCtrl column

I have a CTreeListCtrl in my MFC application.What I need to do is add a button in a particular column of a node when a particular condition is satisfied(type is changed to reference). 所需效果

In the image I have edited and added a blue rounded oval to mark the place of desired button.What I want to do is to invoke a dialog on clicking it.But I don't have any clue whether it is possible or not.If yes then pls give me some suggesions.

This is no normal tree control. It is already customized to use multiple columns and I am sure it uses some kid of owner draw. For me it seams more like a list control with tree Features... I know some similar code from Codepproject..

Creating a "real" button (window) isn't wise/good. because it is another window inside the list control...

  1. Change your code to "Draw a button. You can use DrawFrameControl.
  2. Just intercept the left mouse click. Check the range if this area is cliecked. Fire a user defined message to the parent window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM