StringGridを使用したプログラムを作成しています。
OnDrawCellイベントでDrawTextExを使用して文字列の出力を行うと
DrawTextEx(Self.Canvas.Handle, PChar(S), Length(S), ARect, 0, nil);
文字列Sに「テスト&」と設定した場合、グリッドには「テスト」とだけ
表示され、半角の&が表示されません。
その他の半角記号($,\など)を試したところ、表示されました。
原因、または参考となる情報をお持ちの方、よろしくお願いします。
Win32.hlp より
DT_NOPREFIX Turns off processing of prefix characters. Normally, DrawTextEx interprets the ampersand (&) mnemonic-prefix character as a directive to underscore the character that follows, and the double ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. By specifying DT_NOPREFIX, this processing is turned off.
ですから、第五パラメータに DT_NOPREFIX を設定してください。
ご指摘ありがとうございます。
今試したところ問題の現象が解決しました。
ありがとうございました。
ツイート | ![]() |