Hi .. Thanks for the reply.
I'm implementing this from within the main dialog class of my dialog based app.
Im trying to subclass using 'CColorStaticST', a class which does exactly what I want that I found here on CodeGuru.
My code looks like this:
The author of CColorStaticST obviously intended that a CStatic drawn on the dialog would be used.Code:for(i=0; i<(m_GridXSize * m_GridYSize); i++) { if((i % m_GridXSize) == 0 && (bFirst == FALSE)) { SlabRect.top = SlabRect.top + m_SquareSize; SlabRect.bottom = SlabRect.bottom + m_SquareSize; SlabRect.left = 50; SlabRect.right = SlabRect.left + m_SquareSize; } m_NumberGrid.Add(new CColorStaticST()); ((CColorStaticST*)m_NumberGrid.ElementAt(i))->Create(" ",WS_CHILD |WS_BORDER|WS_VISIBLE, SlabRect, this); ((CColorStaticST*)m_NumberGrid.ElementAt(i))->SubclassDlgItem(/*NEED TO PUT MY OBJECTS HANDLE HERE */, this); SlabRect.OffsetRect(m_SquareSize,0); bFirst = FALSE; }
Hope you can help.
Thanks for your time
Phil




Reply With Quote