1

We have implementation that uses OnCustomDrawItemEvent of treeview to draw items.

NodeRect := Node.DisplayRect(true);
TextRect(NodeRect,NodeRect.Left, NodeRect.Top, sometext);

The issue is that some text is bigger than the width of TreeView, i can identify it with TextWidth(someText) but can`t find a way to enlarge it and display horizontal scrollbar.

Any suggestions?

1
  • Typo on header: TTreeView, not TTreeeView. Commented Jun 7 at 20:00

1 Answer 1

2

Unfortunately, the only way to tell the TreeView how much spacing it needs to calculate its horizontal scrollbar is to put real text of sufficient length into your nodes. Simply drawing on top of the nodes is not enough if they don't have actual text assigned to them.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks i actually filled Text property and worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.