簡體   English   中英

如何在Windows窗體(C#)中設置列表框的確切高度?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM