我在程序中做了两个controlbar,并将他们并排置于主界面的下部,可我却没办法使它们宽度相同,也就是各占主界面的下部的一半。程序执行时总是一个宽一个窄,真是不爽阿,我的cmainframe的oncreate中的代码如下,请哪位高人指点一下,谢了!// Create the output bar.
if (!m_wndOutputBar.Create(this, IDW_OUTPUTBAR, _T("Output"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} // Create the detail bar.
if (!m_wndDetailBar.Create(this, IDW_DETAILBAR, _T("detail"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} m_wndOutputBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
m_wndDetailBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT);
DockControlBar(&m_wndDetailBar);
DockControlBar(&m_wndOutputBar);
DockControlBarLeftOf( &m_wndDetailBar, &m_wndOutputBar );
if (!m_wndOutputBar.Create(this, IDW_OUTPUTBAR, _T("Output"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} // Create the detail bar.
if (!m_wndDetailBar.Create(this, IDW_DETAILBAR, _T("detail"),
CSize(150, 150), CBRS_BOTTOM))
{
TRACE0("Failed to create output dock window\n");
return -1; // fail to create
} m_wndOutputBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
m_wndDetailBar.EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT|CBRS_XT_GRIPPER_GRAD);
EnableDockingEx(CBRS_ALIGN_ANY, CBRS_XT_ALL_FLAT);
DockControlBar(&m_wndDetailBar);
DockControlBar(&m_wndOutputBar);
DockControlBarLeftOf( &m_wndDetailBar, &m_wndOutputBar );
解决方案 »
- 怎么在mfc里调用显示线程的api函数
- 我是初学者请问这个怎么解释(strrchr(FilePach,'\\'))[1]=0
- 有什么函数可以获得到QQ用户名和密码的句柄?
- 我想在vs6中使用免注册com,都需要做哪些操作?
- 怎样制作麦克风测试和声音测试,又没有现成的方法?
- 请问哪里有有关IE编程的资料?
- 请问用什么工具可以提取可执行程序中的图标?
- 为什么有的服务器上串口使用一段时间会异常,重启程序也打不开
- socket api的一个大问题!!!!!
- 对软件客户区进行视频录制,采用截图+压缩至avi的做法,得到的avi视频画面总是有明显的线条,求问如何解决?
- 如何创建一个新的应用层协议的服务?
- 求VC学习的源码
Trying this:
DockControlBar(&m_wndOutputBar,AFX_IDW_DOCKBAR_BOTTOM);
RecalcLayout();
CRect rect;
m_wndOutputBar.GetWindowRect(&rect);
ScreenToClient(rect);
rect.MoveRect(rect.Width()/2,0,0,0);
DockControlBar(&m_wndDetailBar,AFX_IDW_DOCKBAR_BOTTOM,&rect);
我试了你的办法,效果是两个controlbar一上一下置于主界面的下方,并不是一左一右,不知道是怎么回事?请明示在下,万分感谢!
So,I could only give you suggestion by imagination!
In this situation,I think you could think about using CRebar class.
Put the CRebar at the bottom and then add your two control bars.
那你说该如何设置呢?