在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欄中的其他位置時,其圖標消失。
那麼,拖動後圖像可見的解決方案是什麼?
備註:拖動時,窗格會暫時通過一個未連接的狀態,其標題欄較短且沒有圖標,這對我來說似乎不正確。真正令人惱火的是,當窗格被重新鎖定到返回到原始高度的時候,這個圖標並沒有顯示出來。
預先感謝幫助, 塞爾吉奧