Article ID: 148222
Article Last Modified on 11/21/2006
// Dispatch and event IDs
public:
enum {
//{{AFX_DISP_ID(CCirc3Ctrl)
dispidCircleShape = 2L,
dispidCircleOffset = 3L,
dispidFlashColor = 1L,
dispidNote = 4L,
eventidClickIn = 1L,
eventidClickOut = 2L,
//}}AFX_DISP_ID
};
The following sample code shows how to modify the Circ3 sample to
synchronize the CircleShape and CircleOffset properties given the dispids
above.
/* Compile options needed: none
*/
void CCirc3Ctrl::OnCircleShapeChanged()
{
SetModifiedFlag();
// force the control to redraw itself
InvalidateControl();
// reset the circle offset, if necessary
if (m_circleShape)
SetCircleOffset(0);
BoundPropertyChanged(dispidCircleShape); // *ADD THIS LINE*
}
void CCirc3Ctrl::SetCircleOffset(short nNewValue)
{
// Validate the specified offset value
if ((m_circleOffset != nNewValue) && m_circleShape&&
InBounds(nNewValue))
{
m_circleOffset = nNewValue;
SetModifiedFlag();
BoundPropertyChanged(dispidCircleOffset); // *ADD THIS LINE*
InvalidateControl();
}
}
Additional query words: Property Page Form Browser
Keywords: kbinfo kbctrl kbhowto kbpropsheet KB148222