Animate Event Example for C++ 5.0 and later

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

void CTutorDlg::OnAnimateLeadrasterview1(BOOL bEnable) 
{
   CWnd *pButton = GetDlgItem(IDC_BUTTON1);
   if (bEnable == TRUE)
      pButton->SetWindowText(TEXT("Stop Animation"));
   else
      pButton->SetWindowText(TEXT("Start Animation"));
}
void CTutorDlg::OnButton1() 
{
   if (m_LEADRasterView1.GetAnimationEnable())
      m_LEADRasterView1.SetAnimationEnable(FALSE);
   else
      m_LEADRasterView1.SetAnimationEnable(TRUE);
}