Truncation Issue with LVIF_TEXT
Hi,
I am using a CListCtrl object and setting the items in it. Every item in the list is an LVITEM. The mask on one of the sub items is LVIF_TEXT.
LVITEM
lvItem.mask = LVIF_TEXT;
lvItem.pszText = "&&&&"
the pszText is "&&&&" ( 4 & symbols). However, there seems to be a truncation issue when this list is displayed and only "&&" ( 2 & are displayed).
Could you help me in figuring out why this is happening? Is there a known bug in LVIF_TEXT where it truncates symbols other than alphabets and numbers??
Re: Truncation Issue with LVIF_TEXT
It is NOT a bug. It is by design. :cool:
An ampersand (&) has a specific meaning in Windows. From MSDN:
Quote:
An ampersand (&) character in the text indicates that the following character is used as a mnemonic character for the control. When the control is displayed, the ampersand is not shown, but the mnemonic character is underlined. The user can choose the control by pressing the key corresponding to the underlined mnemonic character. To use the ampersand as a character in a string, insert two ampersands (&&).
Re: Truncation Issue with LVIF_TEXT
Hey Victor,
Thanks for the help....
Re: Truncation Issue with LVIF_TEXT
can I use some other mask instead of the LVIF_TEXT mask.....
since, in the List Ctrl I am displaying a subject and I dont want user text to be truncated .....
for example if the user's subject is
Mode of communication is Mail & email, it would display as MailEMail with an underscore below e.
this might lead to a confusion to the user.......
Re: Truncation Issue with LVIF_TEXT
Just replace an ampersand (&) character with two ampersands (&&) before setting the item/subitem text..