By Kingron
例如在窗体上面放一个Button,一个StatusBar(属性AutoHint=True),放一个ApplicationEvents,设置好属性,例如如果你要在Button中显示Short Hint:
Test hint | By Kingron | :-)
Long Hint:
Only for Demo of show '|' in hint | :-)
那么你可以设置Button的Hint属性为:
Test hint ## By Kingron ## :-)|Only for Demo of show '|' in hint | :-)
然后在Application的OnShowHint中写代码:
HintStr := StringReplace(HintStr,'##','|',[rfReplaceAll])
Delphi会自动以Hint属性中第一个|为分隔符,前面的为ShortHint后面的为LongHint,因此在Short Hint中我们不能直接设置|字符,在Long Hint中却可以!!!