在 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
是否有可以设置的属性或可以附加到任一组件上的事件的代码?
最佳答案
默认情况下,&
用于标识标签控件的键盘加速键。要更改此默认行为,请设置 PrefixStyle
属性为 TPrefixStyle.NoPrefix
。
Determines whether the ampersand character (&) is considered as a special prefix character.
The default value is TPrefixStyle.HidePrefix, which means that the (first) ampersand is hidden at run-time.
这是一个公共(public)属性,而不是已发布的属性,因此您需要在代码中进行设置。
关于delphi - 如何在Label和ListView中显示&,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33395715/