title: CMFCOutlookBarPane icons disappearing when dragging
body: <p>In Visual C++, I have a CMFCOutlookBarTabCtrl that has been created with:</p>
  
  <pre><code>CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*) m_wndContextBar.GetUnderlyingWindow();
  </code></pre>
  
  <p>where wndContextBar is a CMyOutlookBar that is a class I derived from CMFCOutlookBar</p>
  
  <p>I also have the 3 CMFCOutlookBarPanes I create within the if below:</p>
  
  <pre><code>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(&amp;m_wndContextBar, dwPaneStyle, PANE0_ID, dwStyle) ||
      !m_wndPane1.Create(&amp;m_wndContextBar, dwPaneStyle, PANE1_ID, dwStyle) ||
      !m_wndPane2.Create(&amp;m_wndContextBar, dwPaneStyle, PANE2_ID, dwStyle))
      )
  {
      ASSERT(FALSE);
      return FALSE;
  }
  </code></pre>
  
  <p>And the code follows:</p>
  
  <pre><code>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-&gt;SetImageList(IDB_CONTEXT_ICONS, 32, RGB(255,255,255));
  
  sTitle.LoadString(IDS_PANE0);
  pOutlookBar-&gt;AddControl(&amp;m_wndPane0, sTitle, 0, TRUE, dwStyle); 
  m_wndPane0.EnableDocking(CBRS_ALIGN_ANY);
  m_wndPane0.SetDefaultState();
  
  sTitle.LoadString(IDS_PANE1);
  pOutlookBar-&gt;AddControl(&amp;m_wndPane1, sTitle, 1, TRUE, dwStyle); 
  m_wndPane1.EnableDocking(CBRS_ALIGN_ANY);
  m_wndPane1.SetDefaultState();
  
  sTitle.LoadString(IDS_PANE2);
  pOutlookBar-&gt;AddControl(&amp;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-&gt;EnableTabSwap(TRUE);
  
  CMFCOutlookBarTabCtrl::EnableAnimation(TRUE);
  
  UpdateMDITabbedBarsIcons();
  </code></pre>
  
  <p>I define that icons will be appearing on the panes with the SetImageList line above. When I create the Toolbar everything is OK. But when I try to drag one of the Panes to another position inside the Outlook bar, its icon disappears.</p>
  
  <p>So, what is the solution for the image to be visible after dragging?</p>
  
  <p>Side note: When dragging, the Pane passes temporarily to a state where it is undocked, where its title bar is shorter and has no icon, which does not seem incorrect to me. What is really irritating is when the Pane is redocked the returns to its original height as expexted, but the icon isn't shown.</p>
  
  <p>Thanks in advance for help,
  Sérgio</p>