在Visual C++时消失,我已经与创建的CMFCOutlookBarTabCtrl:CMFCOutlookBarPane图标拖动
CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*) m_wndContextBar.GetUnderlyingWindow();
其中wndContextBar是CMyOutlookBar即是I类从CMFCOutlookBar
衍生我也有3个CMFCOutlookBarPanes我内若跌破创建:
DWORD dwPaneStyle = AFX_DEFAULT_TOOLBAR_STYLE | CBRS_FLOAT_MULTI;
// can float, can autohide, can resize, CAN NOT CLOSE
DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE | CBRS_GRIPPER;
if (!m_wndPane0.Create(&m_wndContextBar, dwPaneStyle, PANE0_ID, dwStyle) ||
!m_wndPane1.Create(&m_wndContextBar, dwPaneStyle, PANE1_ID, dwStyle) ||
!m_wndPane2.Create(&m_wndContextBar, dwPaneStyle, PANE2_ID, dwStyle))
)
{
ASSERT(FALSE);
return FALSE;
}
,代码如下:
m_wndPane0.SetOwner(this);
m_wndPane1.SetOwner(this);
m_wndPane2.SetOwner(this);
m_wndPane0.EnableTextLabels();
m_wndPane1.EnableTextLabels();
m_wndPane2.EnableTextLabels();
m_wndPane0.EnableDocking(CBRS_ALIGN_ANY);
m_wndPane1.EnableDocking(CBRS_ALIGN_ANY);
m_wndPane2.EnableDocking(CBRS_ALIGN_ANY);
[....]//Code for adding buttons inside the panes, it is irrelevant for this discussion
pOutlookBar->SetImageList(IDB_CONTEXT_ICONS, 32, RGB(255,255,255));
sTitle.LoadString(IDS_PANE0);
pOutlookBar->AddControl(&m_wndPane0, sTitle, 0, TRUE, dwStyle);
m_wndPane0.EnableDocking(CBRS_ALIGN_ANY);
m_wndPane0.SetDefaultState();
sTitle.LoadString(IDS_PANE1);
pOutlookBar->AddControl(&m_wndPane1, sTitle, 1, TRUE, dwStyle);
m_wndPane1.EnableDocking(CBRS_ALIGN_ANY);
m_wndPane1.SetDefaultState();
sTitle.LoadString(IDS_PANE2);
pOutlookBar->AddControl(&m_wndPane2, sTitle, 2, TRUE, dwStyle);
m_wndPane2.EnableDocking(CBRS_ALIGN_ANY);
m_wndPane2.SetDefaultState();
m_wndContextBar.SetPaneStyle(m_wndContextBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndContextBar.FillDefaultTabsOrderArray();
pOutlookBar->EnableTabSwap(TRUE);
CMFCOutlookBarTabCtrl::EnableAnimation(TRUE);
UpdateMDITabbedBarsIcons();
我定义图标将出现在上面的SetImageList行的窗格上。当我创建工具栏时,一切正常。但是,当我尝试将其中一个窗格拖到Outlook栏中的其他位置时,其图标消失。
那么,拖动后图像可见的解决方案是什么?
备注:拖动时,窗格会暂时通过一个未连接的状态,其标题栏较短且没有图标,这对我来说似乎不正确。真正令人恼火的是,当窗格被重新锁定到返回到原始高度的时候,这个图标并没有显示出来。
预先感谢帮助, 塞尔吉奥