I was wondering why the TTreeView cuts off my text at the 259th character.
I have already found some forums and website, where they say it is a limitation of Windows.
Does it also apply to the C++ Builder 2010?
And if it is, why is it possible to store more characters in the TreeNode property?
Because that is simply how a standard Win32 TreeView control works. This is documented behavior on MSDN:
TVITEMA structure (commctrl.h)
TVITEMW structure (commctrl.h)
If you need to display more characters, you will have to draw the TreeView nodes yourself using the
TTreeView::OnCustomDrawItemorTTreeView::OnAdvancedCustomDrawItemevent.Yes, because the
TTreeViewcomponent is just a wrapper for the standard Win32 TreeView control.Because the
TTreeNode::Textproperty is just a plainSystem::String, so it can be as long as memory allows. But when theTTreeNode::Textis applied to the underlying Win32 TreeView (in response to aTVN_GETDISPINFOnotification), theTextis copied into whatever buffer the OS decides to receive the text into, and the OS displays only 260 characters from that buffer.