DrawTextExの制限?

解決


iruy  2006-01-13 22:15:03  No: 19605

StringGridを使用したプログラムを作成しています。

OnDrawCellイベントでDrawTextExを使用して文字列の出力を行うと
DrawTextEx(Self.Canvas.Handle, PChar(S), Length(S), ARect, 0, nil);

文字列Sに「テスト&」と設定した場合、グリッドには「テスト」とだけ
表示され、半角の&が表示されません。
その他の半角記号($,\など)を試したところ、表示されました。

原因、または参考となる情報をお持ちの方、よろしくお願いします。


えーと  2006-01-13 22:20:36  No: 19606

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 を設定してください。


iruy  2006-01-13 23:42:46  No: 19607

ご指摘ありがとうございます。
今試したところ問題の現象が解決しました。
ありがとうございました。


※返信する前に利用規約をご確認ください。

※Google reCAPTCHA認証からCloudflare Turnstile認証へ変更しました。






  このエントリーをはてなブックマークに追加