开发者

C# Adding a long string to combobox

开发者 https://www.devze.com 2022-12-21 03:25 出处:网络
In my window application i created a Combobox. My开发者_如何学运维 requirement is like, if i add a long string to combobox and when i will expend that combobox, in the list view that string should com

In my window application i created a Combobox. My开发者_如何学运维 requirement is like, if i add a long string to combobox and when i will expend that combobox, in the list view that string should come completely.


Modify the DropDownWidth property of your combobox object to accomodate long strings.


Look at this answer comboBox width depending on longest item - it explains that you can use MeasureString to measure the length of the text for all of the items, then I would recommend padding it by at least 24 pixels, and then set the length.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号