Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to display character '|' as part of TComboBox->Hint ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Mar 6, 2017 10:42 AM Last Post By: Remy Lebeau (Te...
GAI CHEW KAI

Posts: 117
Registered: 7/25/14
How to display character '|' as part of TComboBox->Hint ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 5, 2017 6:34 PM
Embarcadero® C++Builder XE8 Version 22.0.19027.8951
Android 6.0.1.
Windows 10 Pro x64, 10.0.14393.

How to display character '|' under property Hint of TComboBox ?

For example, I specified: This is a record of MAC|John|

...when mouse over, the hint shown MAC only.

Please advise.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to display character '|' as part of TComboBox->Hint ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 6, 2017 10:42 AM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
GAI wrote:

How to display character '|' under property Hint of TComboBox ?

'|' is reserved as a delimiter between a short hint string and a long hint
string. This is documented behavior:

http://docwiki.embarcadero.com/RADStudio/en/Using_Hints_to_Show_Contextual_Help_in_a_FireMonkey_Application#Short_and_Long_Hints

As such, a short hint string cannot contain a '|' character, only the long
hint string can. So, you would have to define a short hint string (even
if it is blank) so that you can then define a long hint string containing
whatever you want, eg:

ComboBox1.Hint := '|This is a record of MAC|John|';
 
...
 
// TApplication.OnHint or TApplicationEvents.OnHint event handler ...
procedure TForm1.OnApplicationHint(Sender: TObject);
begin
  // display GetLongHint(Application.Hint) where needed...
end;


--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02