GetSelectedAnnotationLineStyle Example VC++

This example uses the GetSelectedAnnotationLineStyle method to determine whether a selected line or hollow rectangle annotation is opaque or transparent, and the SetSelectedAnnotationLineStyle method to change the line style.

void CLineStyles::OnOK() 
{
    if(m_Transparent.GetCheck() && m_bLineStyle)
      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);
    else
      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);

    if(m_Transparent.GetCheck() && !m_bLineStyle)
      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);
    else
      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);

    CDialog::OnOK();
}
BOOL CLineStyles::OnInitDialog() 
{
    CDialog::OnInitDialog();
    short LineStyle;

    // Determine if the selected line or fill annotation is opaque or
    // transparent and set the corresponding option button on
    // the form.
    if(m_bLineStyle)
      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();
    else
     {
      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();
      SetWindowText("Fill Styles");
     }

    if(LineStyle == 1)  //  wiOpaque 
     {
      m_Opaque.SetCheck(1);
      m_Transparent.SetCheck(0);
     }
    else
     {
      m_Opaque.SetCheck(0);
      m_Transparent.SetCheck(1);
     }

    return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
}