5

I have an application that allows the users to enter a regular expression (that they craft) to parse a repository of documents. The results of the search are displayed in a TTreeView control. I want to set the TreeView's Hint property (not each Treenode) to the regular expression that was used, but the problem I'm having is that the regular expression can have a pipe (|) character within it (regex OR), which Delphi interprets as the separation between the hint and long hint. I tried replacing each occurrence of | with || hoping it would have the same effect as using && rather than & (such as in menu items) to no avail.

Is there any way to embed a | within a hint without it being interpreted as the separator?

4

1 回答 1

4

不准确,但可能足够接近

 Component.Hint := Stringreplace(TheHintText,'|',#5,[rfReplaceAll]);
于 2013-04-17T15:41:53.047 回答