Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put a literal vertical bar "|" in a control's Hint property?

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?

like image 569
A Lombardo Avatar asked Oct 05 '22 09:10

A Lombardo


1 Answers

Not exact but perhaps near enough

 Component.Hint := Stringreplace(TheHintText,'|',#5,[rfReplaceAll]);
like image 125
bummi Avatar answered Oct 11 '22 01:10

bummi