DrawText !!
-
Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.
-
Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.
Either double the & character, or use the DT_NOPREFIX flag (i.e. specify
DT_LEFT | DT_NOPREFIX
). This feature is intended for use by various Windows functions to indicate accelerator keys for activating controls. Windows 2000 and higher, by default, hide the accelerator key indicators until the Alt key is pressed, so you may not have seen this behaviour. Stability. What an interesting concept. -- Chris Maunder -
Hi everybody, I'am using the DrawText function to draw this text "p&m": DrawText(_T("p&m"),LPRECT(CRect(0,0,100,100)),DT_LEFT); but my problem is that the text on the screen appear with the 'm' underlined. could someone help me!! thanks.
What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:
DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
For more details look up escape characters on msdn
-
What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:
DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
For more details look up escape characters on msdn
DrawText(_T("Thank you Mike && mikanu for your help"), LPRECT(CRect(0,0,100,100)), DT_LEFT | DT_NOPREFIX) ;)