簡體   English   中英

調整 windows 窗體中報表查看器工具欄的高度

[英]Adjust the height of Report viewer toolbar in windows form

我在 windows 表單中使用報表查看器,並且正在嘗試調整ReportViewerToolStrip的高度。

我試圖將AutoSize屬性調整為false然后調整Height但高度沒有改變:

var toolStrip = (ToolStrip)reportViewer1.Controls.Find("toolStrip1", true).First();
toolStrip.AutoSize = false;
toolStrip.Height = 100;
        

如何在 windows 表單中調整報表查看器工具欄的高度? 任何建議將不勝感激。

報表查看器的ToolStrip在自定義控件(報表工具欄)中有Dock = Fill 報告工具欄已覆蓋與大小相關的方法和屬性,並查看ToolStripPreferredSize以設置邊界。

PaddingImageScalingSizeMinimumSizeFont等屬性有助於確定工具條的首選大小; 所以你可以設置任何一個提到的屬性。

最有效的屬性是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.

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