【问题标题】:How to displaying & in Labels and ListView如何在 Labels 和 ListView 中显示 &
【发布时间】:2016-01-28 12:02:34
【问题描述】:

在 Delphi 10 Seattle 中使用 FireMonkey 编写一个多平台电话目录应用程序

数据存储在 XML 文件中。 屏幕上有一个显示人名的 ListView 和一个显示姓名、地址、电话号码等的详细信息选项卡。

当名字:Doe, John & Jane 显示它在两个组件中的处理方式不同。

The ListView shows:  Doe, John & Jane
The NameLabel shows: Doe, John Jane

如果我在 XML 中转义 &Doe, John && Jane

The ListView shows:  Doe, John && Jane
The NameLabel shows: Doe, John & Jane

是否有可以设置的属性或可以附加到任一组件上的事件的代码?

【问题讨论】:

    标签: delphi listview firemonkey delphi-xe


    【解决方案1】:

    默认情况下,& 用于标识标签控件的键盘加速键。要更改此默认行为,请将PrefixStyle 属性设置为TPrefixStyle.NoPrefix

    确定与号字符 (&) 是否被视为 特殊前缀字符。

    默认值为 TPrefixStyle.HidePrefix,表示 (第一) & 符号在运行时被隐藏。

    这是一个公共而不是已发布的属性,因此您需要在代码中进行设置。

    【讨论】:

      猜你喜欢
      • 2023-03-03
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 2016-08-30
      • 2019-08-23
      • 1970-01-01
      相关资源
      最近更新 更多