![](/img/trans.png)
[英]How can I bind a collection of C# 7.0 tuple type values to a System.Windows.Forms.Listbox and set the display member to one of the elements?
[英]How can I set the exact height of a listbox in Windows Forms (C#)?
我在設置列表框的高度方面遇到了一些困難。
像這樣的代碼......
listbox1.Height = some_number;
...僅適用於某些數字。 似乎列表框的高度可能只是其元素高度的倍增。 有沒有辦法如何“覆蓋”這種行為?
嘗試,
listbox1.IntegralHeight=false;
listbox1.Height=some_int_number;
首先,設置
listbox1.IntegralHeight = false;
對於VBA代碼:
ActiveSheet.Shapes("ListBox1").ScaleWidth some_relate_numb, msoFalse, _ msoScaleFromTopLeft
listbox1.IntegralHeight=false
listbox1.Height=some_int_number
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.