I have a CTreeCtrl
object (C++, MFC). This CTreeCtrl
remembers the last selection and if the user opens the window again the last selection will be expand and select automatically. But when I call EnsureVisible
to show the last selection, it appears at the bottom of the TreeCtrl. I tried a lot (for example this How to make a CTreeCtrl item centrally displayed?) but it has no effect to my TreeControl.
Does anyone know a good way to expand and show items in the middle of a TreeControl (programmatically)? A example would be great!