This example uses the MarkSelect event and the EditSelectedAnnotationText method to allow the user to edit the text of an existing, selected annotation mark.
void CImgEdit2Dlg::OnAnnotext()
{
// This would allow the user to edit the text of an existing
// selected annotation mark
TRY {
// Coordinates of the mark are obtained from the MarkSelect
// event (see code below).
ImgEdit1.EditSelectedAnnotationText(m_MarkLeft, m_MarkTop);
}
CATCH (COleDispatchException, e)
{
// Handle error if no mark is selected or the wrong type
// of mark is selected
AfxMessageBox(e->m_strDescription);
//Err.Description
}
END_CATCH
}
void CImgEdit2Dlg::OnMarkSelect(short Button, short Shift, long Left,
long Top, long Width, long Height, short MarkType, LPCTSTR GroupName)
{
m_MarkLeft = Left;
m_MarkTop = Top;
}