更改下拉列表的默认宽度和高度 [英] changin the default width and height of the dropdownlist

查看:44
本文介绍了更改下拉列表的默认宽度和高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个足够宽的下拉列表,以容纳主控件显示区域下拉列表中较大的项目.(即具有 MX Combobox 功能的下拉列表)请指导我.

i want a dropdownlist that is wide enough to accommodate the larger item in the dropdown in display area of the main control.(.i.e. dropdownlist with the functionality of MX Combobox) please guide me on this .

推荐答案

您应该创建自定义 DropDownList(扩展原始)并覆盖 dataProvider setter 和 measure() 方法.在 dataProvider setter 中你应该调用 invalidateSize() 并且在测量中你应该迭代你的数据提供者并找到最大的标签(你可以为标签分配新文本并比较它们的宽度).

You should create custom DropDownList (extending original) and override dataProvider setter and measure() method. In dataProvider setter you should invoke invalidateSize() and in measure you should iterate your data provider and find the largest label (you can assign new text to the label and compare their width).

这篇关于更改下拉列表的默认宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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