VC界面库Xtreme Toolkit Pro使用教程:如何通过代码调整窗格的大小

通过代码调整窗格的大小,必须使用SetSize方法将最大和最小窗格宽度设置为相同的大小。将最小宽度和最大宽度设置为相同大小会导致窗格被调整为指定的设置大小,但是也会“锁定”窗格,因此无法调整大小。

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最新试用版!

【同类产品推荐】

  • BCGControlBar Professional Edition for MFC | 下载试用: 是一个MFC扩展库,使您可以创建具有完全自定义的选项以及一组专业设计的丰富Microsoft Office和Microsoft Visual Studio的应用程序 GUI控件,例如图表、日历、网格、编辑器、甘特图和许多其他控件。
  • BCGControlBar for .NET | 下载试用 :包含有大量高度自定义、完全可设计的.NET界面控件,用户可以使用这些来创建精致美观的图形用户界面。

若要通过代码调整窗格的大小,必须使用SetSize方法将最大和最小窗格宽度设置为相同的大小。将最小宽度和最大宽度设置为相同大小会导致窗格被调整为指定的设置大小,但是也会“锁定”窗格,因此无法调整大小。

若要允许调整窗格的大小,必须调用NormalizeSplitters方法,然后可以再次使用SetSize设置可以调整窗格的最小和最大宽度。这次不会调整窗格的大小,因为在设置宽度和高度之前已调用NormalizeSplitters。

Dim A As Pane'Add a pane that is 50x50Set A = DockingPaneManager.CreatePane(1, 50, 50, DockLeftOf)A.Title = "Pane A"'Only needs to be called if setting the size in Form_LoadDockingPaneManager.RecalcLayout'setting the minimum and maximum track size to the same size'will resize the pane to the specified widthheight and lock'the pane to the specified size.''Below, the pane will be resized to 100x100 and can not be'resizedDockingPaneManager.FindPane(1).MinTrackSize.SetSize 100, 100DockingPaneManager.FindPane(1).MaxTrackSize.SetSize 100, 100'Only needs to be called if setting the size in Form_LoadDockingPaneManager.RecalcLayout'NOTE:'If the pane is docked to the LeftRight, then the "Width" will'be used, if docked to the TopBottom, 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 paneDockingPaneManager.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, 0DockingPaneManager.FindPane(1).MaxTrackSize.SetSize 500, 500

今天的内容就是这些了,下载最新版Xtreme ToolKit Pro并在下方评论区分享您对该产品的想法。您的反馈意见可帮助我们在以后的更新中找到正确的方向,作为Codejock的正版代理商现Xtreme ToolKit Pro正版授权最高立减2000元!

标签:

来源:慧都

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年8月1日
下一篇 2020年8月1日

相关推荐

发表回复

登录后才能评论