|
-
September 26th, 2008, 11:42 PM
#1
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??
-
September 29th, 2008, 03:27 AM
#2
Re: Truncation Issue with LVIF_TEXT
It is NOT a bug. It is by design.
An ampersand (&) has a specific meaning in Windows. From MSDN:
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 ( &&).
Last edited by VictorN; October 8th, 2008 at 05:06 AM.
Victor Nijegorodov
-
October 7th, 2008, 10:18 PM
#3
Re: Truncation Issue with LVIF_TEXT
Hey Victor,
Thanks for the help....
-
October 13th, 2008, 07:42 AM
#4
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.......
-
October 13th, 2008, 07:53 AM
#5
Re: Truncation Issue with LVIF_TEXT
Just replace an ampersand (&) character with two ampersands (&&) before setting the item/subitem text..
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|