本文介绍了展开 ListBox 中的选定项高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
有没有办法让 SelectedItem 的高度大于 ListBox 中的其他项目?这是我现在拥有的,但它只是作为一个普通的列表框:
Is there a way that I can have the SelectedItem's height larger than the rest of the items in a ListBox? This is what I have right now, yet it just acts as a normal listbox:
推荐答案
当 DrawMode 为 OwnerDrawFixed 时,您的 OnMeasureItem 没有执行任何操作.将模式更改为 OwnerDrawVariable.
Your OnMeasureItem isn't doing anything while the DrawMode is OwnerDrawFixed. Change the mode to OwnerDrawVariable.
不幸的是,MeasureItem 事件仅在创建句柄时发生,所以这里有一个解决方法:
Unfortunately, the MeasureItem event only happens when the handle gets created, so here is a work-around:
这篇关于展开 ListBox 中的选定项高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!