Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当字符串太长而无法完整显示时,有没有办法设置字符串的哪一部分显示在 WPF 组合框中?
例如,我有一个字符串“my very long string”,当它被选中时,会被截断为“my very l”。我想改为显示“长字符串”。
我希望这是有道理的!
如果您指定了绑定,则可以使用考虑字符串长度的值转换器,如果它大于某个值,则修剪字符串并添加“...”