0

As this picture show:

enter image description here

The blue line is what I want. However, I can't find anything about it on the Internet. All I know is that create a class inherited TreeControl, by doing so, it become dragable.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
BoKuan Liu
  • 21
  • 1
  • 6

1 Answers1

0

You are looking for an owner-drawn control.

Here is one example: https://www.codeproject.com/Articles/19900/CRHTree-An-Owner-drawn-CTreeCtrl-that-has-Open-Clo

Yours going to be more complicated, as you would need to know that some of the items are not only source and destination of those arrows, but also may be a pass-through. Are you planning to adjust how far right the line is drawn based on the text of all visible items in between? And change it when user expands / collapses them?

Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27
  • I appreciate your suggestion. About your question: 1. There is no need to adjust the distance from the text to the line, just not to be a pass-through. 2. Do expandsion mean lengthen the item's width?(add some text to the item) And callpase mean deleting some items? If it does, the connection between item and item (blue line) should also be deleted. – BoKuan Liu Dec 01 '20 at 06:17
  • @劉柏寬 - by `expand` and `collapse` I mean `open`/`close` the "folder" items (`+` and `-` buttonsin your tree). If they are between the start and end of the arrow line, it may need to go farther to the right to accommodate new items. – Vlad Feinstein Dec 01 '20 at 17:43
  • No, there is no need to expand and collapse. – BoKuan Liu Dec 02 '20 at 16:32