This example uses the GetSelectedAnnotationBackColor method, the SetSelectedAnnotationBackColor method, and the Microsoft common dialog box to change the background color of a selected text annotation.
void CImgEdit2Dlg::OnBackcolor()
{
// This example uses the Microsoft color dialog box to change
// a selected text attachment annotation mark's background color.
long BackColor;
// Determine the current color of the selected annotation
// mark and init the dialog box color property to that color.
BackColor = ImgEdit1.GetSelectedAnnotationBackColor();
CommonDialog1.SetColor(BackColor);
CommonDialog1.SetFlags(1); // cdlCCRGBInit
CommonDialog1.ShowColor();
ImgEdit1.SetSelectedAnnotationBackColor(CommonDialog1.GetColor());
}