翻譯|使用教程|編輯:鮑佳佳|2020-09-27 16:04:31.530|閱讀 289 次
概述:若要通過代碼調整窗格的大小,必須使用SetSize方法將最大和最小窗格寬度設置為相同的大小。將最小寬度和最大寬度設置為相同大小會導致窗格被調整為指定的設置大小,但是也會“鎖定”窗格,因此無法調整大小。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Xtreme Toolkit Pro是MFC開發中最全面界面控件套包,它提供了Windows開發所需要的11種主流的Visual C++ MFC控件,包括Command Bars、Controls、Chart Pro、Calendar、Docking Pane、Property Grid、Report Control、Shortcut Bar、Syntax Edit、Skin Framework 和Task Panel。如果對產品感興趣的話歡迎下載Xtreme Toolkit Pro最新試用版! 點擊獲取更多免費Xtreme Toolkit Pro教程、視頻、示例!
【同類產品推薦】
若要通過代碼調整窗格的大小,必須使用SetSize方法將最大和最小窗格寬度設置為相同的大小。將最小寬度和最大寬度設置為相同大小會導致窗格被調整為指定的設置大小,但是也會“鎖定”窗格,因此無法調整大小。
若要調整窗格的大小,必須調用NormalizeSplitters方法,然后可以再次使用SetSize設置可以調整窗格的最小和最大寬度。這次不會調整窗格的大小,因為在設置寬度和高度之前已調用NormalizeSplitters。
Dim A As Pane 'Add a pane that is 50x50 Set A = DockingPaneManager.CreatePane(1, 50, 50, DockLeftOf) A.Title = "Pane A" 'Only needs to be called if setting the size in Form_Load DockingPaneManager.RecalcLayout 'setting the minimum and maximum track size to the same size 'will resize the pane to the specified width\height and lock 'the pane to the specified size. ' 'Below, the pane will be resized to 100x100 and can not be 'resized DockingPaneManager.FindPane(1).MinTrackSize.SetSize 100, 100 DockingPaneManager.FindPane(1).MaxTrackSize.SetSize 100, 100 'Only needs to be called if setting the size in Form_Load DockingPaneManager.RecalcLayout 'NOTE: 'If the pane is docked to the Left\Right, then the "Width" will 'be used, if docked to the Top\Bottom, then the "Height" 'specified will be used. The only time both width and height 'are used to size a pane is when the pane is floating. 'Remembers previous pane size settings so that the next call 'to SetSize will not resize the pane DockingPaneManager.NormalizeSplitters 'sets the minimum and maximum sizes the splitter can move 'Note, this will not resize the pane since NormalizeSplitters 'was called before the call to SetSize. Now SetSize will 'only specify how large/small the user can resize the pane. 'Below, the pane can be resized between 0x0 and 500x500. DockingPaneManager.FindPane(1).MinTrackSize.SetSize 0, 0 DockingPaneManager.FindPane(1).MaxTrackSize.SetSize 500, 500
今天的內容就是這些了,下載最新版Xtreme ToolKit Pro并在下方評論區分享您對該產品的想法。您的反饋意見可幫助我們在以后的更新中找到正確的方向,慧都作為Codejock的正版代理商現Xtreme ToolKit Pro正版授權最高立減2000元! Xtreme Command Bars在線訂購最低僅需1105元!
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: