{"id":122,"date":"2008-06-05T17:02:51","date_gmt":"2008-06-06T01:02:51","guid":{"rendered":"http:\/\/www.curlybrace.com\/words\/?p=122"},"modified":"2008-11-09T10:18:50","modified_gmt":"2008-11-09T18:18:50","slug":"placing-underlined-character-into-win32-tooltip","status":"publish","type":"post","link":"https:\/\/www.curlybrace.com\/words\/2008\/06\/placing-underlined-character-into-win32-tooltip\/","title":{"rendered":"Underlining Characters in a ToolTip"},"content":{"rendered":"<p>My product, a toolbar for Outlook Express, uses <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb760246(VS.85).aspx\">tooltips<\/a> to display keyboard shortcuts.  For some localization work, I needed to display an underlined character within a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb760246(VS.85).aspx\">tooltip<\/a>.<\/p>\n<p>The only hint I could find was <a href=\"http:\/\/groups.google.com\/group\/microsoft.public.vb.general.discussion\/msg\/0f48773dfef470c6?hl=en\">a reference to .Net tooltips<\/a>.<\/p>\n<p>Apparently, in both .Net and Win32 tooltips, a single ampersand will be stripped, a double ampersand will cause the next character to be underlined, and three ampersands will display a single ampersand.<\/p>\n<blockquote>\n<table>\n<tr>\n<th>Input<\/th>\n<td>&nbsp;&nbsp;&nbsp;<\/td>\n<th>Displayed<\/th>\n<\/tr>\n<tr>\n<td><tt>&amp;B<\/tt><\/td>\n<td><\/td>\n<td>B<\/td>\n<\/tr>\n<tr>\n<td><tt>&amp;&amp;<\/tt>B<\/td>\n<td><\/td>\n<td><u>B<\/u><\/td>\n<\/tr>\n<tr>\n<td><tt>&amp;&amp;&amp;B<\/tt><\/td>\n<td><\/td>\n<td>&amp;B<\/td>\n<\/tr>\n<\/table>\n<\/blockquote>\n<p>Note that this will be affected if the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb760248.aspx\"><tt>TTS_NOPREFIX<\/tt><\/a> flag is set, which prevents ampersands from being stripped.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My product, a toolbar for Outlook Express, uses tooltips to display keyboard shortcuts. For some localization work, I needed to display an underlined character within a tooltip. The only hint I could find was a reference to .Net tooltips. Apparently, &hellip; <a href=\"https:\/\/www.curlybrace.com\/words\/2008\/06\/placing-underlined-character-into-win32-tooltip\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,199],"tags":[],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-technology","category-win32-technology-2"],"_links":{"self":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":2,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":560,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/122\/revisions\/560"}],"wp:attachment":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}