Partager via


CSplitterWnd::IdFromRowCol

Obtains the child window ID for the pane at the specified row and column.

int IdFromRowCol(
   int row,
   int col 
) const;

Parameters

  • row
    Specifies the splitter window row.

  • col
    Specifies the splitter window column.

Return Value

The child window ID for the pane.

Remarks

This member function is used for creating nonviews as panes and may be called before the pane exists.

Example

HBRUSH CMySplitterWnd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
   HBRUSH hbr = CSplitterWnd::OnCtlColor(pDC, pWnd, nCtlColor);

   if(nCtlColor == CTLCOLOR_LISTBOX && 
      pWnd->GetDlgCtrlID() == IdFromRowCol(1,0))
   {
      // Pane 1,0 is a list box. Set the color of the text to be blue.
      pDC->SetBkColor(m_BkColor);
      pDC->SetTextColor(RGB(0,0,255));
      return (HBRUSH)m_hbrListBoxBkgnd.GetSafeHandle();
   }
   // TODO: Return a different brush if the default is not desired
   return hbr;
}

Requirements

Header: afxext.h

See Also

Reference

CSplitterWnd Class

Hierarchy Chart

CSplitterWnd::GetPane

CSplitterWnd::IsChildPane

Other Resources

CSplitterWnd Members