如何停止DrawText从下划线替换字符? [英] How to stop DrawText from underlining alt characters?

查看:390
本文介绍了如何停止DrawText从下划线替换字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 DrawText 将文本绘制到DBGrid画布上。文本来自数据库。但是当字符串包含&符号(&)时,它将它视为 alt 快捷方式并加下划线。

I'm using DrawText to draw text onto a DBGrid canvas. The text comes from the database. But when the string contains an ampersand (&) it treats it as an alt shortcut and underlines it.

例如,应该是什么


羊毛&丝绸

Wool & Silk

卷起


羊毛_Silk

Wool _Silk

如何阻止这种行为?

推荐答案

使用 DT_NOPREFIX 标志。如果你知道你不想要任何前缀,那么这就是前进的道路。

Suppress prefix handling with the DT_NOPREFIX flag. This is the way forward if you know you do not want any prefixes drawn.

如果你想用两个前缀和&符号来绘制文本,你可以通过加倍翻转和符号它了所以通过&当你想要一个&符号

If you want to draw text with both prefixes and ampersand, you can escape the ampersand by doubling it up. So pass && when you want a single ampersand.

您可以在文档

这篇关于如何停止DrawText从下划线替换字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆