询问者
关于CDockablePane停靠位置的问题

问题
全部回复
-
Hi Hota_CT,
感谢在MSDN论坛发帖。
>>现在CDockablePane窗口停靠在左边,我可以用手动拖动改变其停靠位置
我现在想用程序改变他停靠的位置,使其停靠在右边或者下边,
有什么办法实现吗?
你可以通过设置对齐方式来实现。CDockablePane中有以下四种对齐方式。
你可以通过CDockablePane::SetAutoHideMode, CDockablePane::DockToWindow等函数来实现。例如:
pParentBar->SetAutoHideMode(true, CBRS_ALIGN_RIGHT);
希望对你有所帮助。
Best Regards,
Sera Yu
MSDN Community Support<br/> Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.
-
我得意思是,做一个响应,触发这个响应事件,使其改变停靠位置,
我自己看了源码,想了两条路径,
一个是模仿手动拖动得行为
在CPaneFrameWnd::OnMouseMove 的时候生成
CPaneFrameWnd::OnLButtonUp的时候确定左右上下位置,
而后调用CPaneFrameWnd::DockPane(FALSE)完成移动的操作,
这条路径的参数我无法准确的设置,导致这个功能也不太对
第二个就是模仿双击的动作调用CMultiPaneFrameWnd::OnDockToRecentPos
这个函数停靠的位置是根据CRecentDockSiteInfo m_recentDockInfo这个参数确定其停靠位置
我只要吧这个参数修改为我要自己停靠的位置就好,但这个参数具体修改的思路我也没有
请问你有什么好的办法或者思路吗?