different formats of text in the same multiline node
I have an instance of TVirtualStringTree
that formats text of a node in two different ways. The implementation is based on using toShowStaticText
in the StringOptions
as described in the accepted answer of this question: VirtualTreeView - different color of text in the same node
Everything used to work fine until I've set the MultiLine
flag for the nodes. Now the OnPaintText
event will no longer be triggered having TextType = ttStatic
.
The reason for this behaviour can be found in the TCustomVirtualStringTree.DoPaintNode
method and is obviously intended:
// ... and afterwards the static text if not centered and the node is not multiline enabled.
if (Alignment <> taCenter) and not (vsMultiline in PaintInfo.Node.States) and (toShowStaticText in TreeOptions.FStringOptions) then
begin
S := '';
with PaintInfo do
DoGetText(Node, Column, ttStatic, S);
if Length(S) > 0 then
PaintStaticText(PaintInfo, TextOutFlags, S);
end;
Nevertheless, I want to have two different text formats in the same MultiLine
Node. How can I do that?
上一篇: 如何做到这一点,使节点根本没有父母
下一篇: 不同格式的文本在同一个多行节点中