如何让CControlBar只浮动, 不停靠

fat_how 2004-12-05 11:04:09
即CControlBar创建出来就是浮动的, 而且不能让他停靠

谢谢
...全文
121 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wxshzf 2005-07-15
  • 打赏
  • 举报
回复
mark
真的李小龙 2004-12-05
  • 打赏
  • 举报
回复
FloatControlBar(m_myControlBar, CPoint(500,10));//将你的CControlBar悬浮在point处
qrlvls 2004-12-05
  • 打赏
  • 举报
回复
对于 CControlBar 也一样,关键是使用 m_barControl.EnableDocking(FALSE);
qrlvls 2004-12-05
  • 打赏
  • 举报
回复
来自CxImage 的代码:

class DlgHisto : public CDialogBar
{
public:
BOOL Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID );
BOOL Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID );

void InitDlg();
...

关键在于下面的部分代码:

BOOL DlgHisto::Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName, UINT nStyle, UINT nID)
{
BOOL bSuccess = CDialogBar::Create(pParentWnd, lpszTemplateName, nStyle, nID);
InitDlg();
return bSuccess;
}
/////////////////////////////////////////////////////////////////////////////
BOOL DlgHisto::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
{
BOOL bSuccess = CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID);
InitDlg();
return bSuccess;
}

调用时的代码:
m_HistoBar.Create(this, IDD_HISTO, CBRS_TOP, ID_VIEW_HISTOGRAM);
m_HistoBar.ShowWindow(0);
m_HistoBar.EnableDocking(0);

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧