I found what seems like a TTreeView related TTreeView .
- Take the form containing the
TTreeView with HideSelection set to True . - Make a multiscreen view of the tree and select several elements in the tree structure.
- Show another form so that your application has two forms.
- Let the tree view the focus, and then click in a different shape.
The result is as follows:

But in fact, there should not be selected elements. Interestingly, the last item is selected, and it no longer stands out, like all other items. It seems that the most recent click was the one that receives special treatment.
If instead you click in the edit box (or, indeed, on any other control that focuses), then all elements will be correctly hidden. So this is great in order to focus on porting to another control on the form - the problem seems to be limited to deactivating the form.
I found a trial version and an error to fix this by calling Invalidate in the tree view whenever the form is deactivated and activated (you need to prevent the error from being mirrored). However, I am looking for a better understanding of what the error is, and how to fix it in a less invasive way, that is, at the level of the tree image, and not at the level of the contained form.
So, in short, my questions are:
- What exactly causes the problem?
- How can I fix this without writing code that captures
TForm events?
The question is presented as QC # 94908 .
David heffernan
source share