[英]Adjust the height of Report viewer toolbar in windows form
我在 windows 表單中使用報表查看器,並且正在嘗試調整ReportViewer
的ToolStrip
的高度。
我試圖將AutoSize
屬性調整為false
然后調整Height
但高度沒有改變:
var toolStrip = (ToolStrip)reportViewer1.Controls.Find("toolStrip1", true).First();
toolStrip.AutoSize = false;
toolStrip.Height = 100;
如何在 windows 表單中調整報表查看器工具欄的高度? 任何建議將不勝感激。
報表查看器的ToolStrip
在自定義控件(報表工具欄)中有Dock = Fill
。 報告工具欄已覆蓋與大小相關的方法和屬性,並查看ToolStrip
的PreferredSize
以設置邊界。
Padding
、 ImageScalingSize
、 MinimumSize
、 Font
等屬性有助於確定工具條的首選大小; 所以你可以設置任何一個提到的屬性。
最有效的屬性是MinimumSize
:
var toolStrip = (ToolStrip)reportViewer1.Controls.Find("toolStrip1", true).First();
toolStrip.MinimumSize = new Size(0, 100);
toolStrip.Parent.Height = 0; // No effect, just to force recalculation of height.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.