-
July 4th, 2012, 04:40 AM
#1
SetWindowText is removing & charatcter in a string.
Hi,
Im passing "& temp1 & temp2" string as a parameter to SetWindowText("& temp1 & temp2"). not sure why it sets the text as temp1 temp2. & character is getting removed.
Last edited by resumurof; July 4th, 2012 at 05:03 AM.
-
July 4th, 2012, 05:18 AM
#2
Re: SetWindowText is removing & charatcter in a string.
Originally Posted by resumurof
Hi,
Im passing "& temp1 & temp2" string as a parameter to SetWindowText("& temp1 & temp2"). not sure why it sets the text as temp1 temp2. & character is getting removed.
That is because for certain classes of windows, the '&' denotes that the next letter is the "shortcut" letter (the letter that is underlined in a button, for example).
So as an example, if the window was a button, using SetWindowText("C&ancel") will have the 'a' underlined, which means that the 'a' is the hotkey/shortcut. To actually place an ampersand as text, you use two successive ampersands.
Code:
SetWindowText("&& temp1 && temp2");
Regards,
Paul McKenzie
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
|