SetSelectedAnnotationFillColor Example VB

This example uses the GetSelectedAnnotationFillColor method to determine the fill color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFillColor method to change the fill color of a selected annotation.

Private Sub cmdFillColor_Click()
    'This example uses the Microsoft color dialog box to
    'change a selected annotation mark's fill color.
    Dim FillColor As Long
    
    'Determine the current color of the selected annotation
    'mark and init the dialog box color property to that color.
    FillColor = ImgEdit1.GetSelectedAnnotationFillColor
    CommonDialog1.Color = FillColor
    CommonDialog1.Flags = cdlCCRGBInit
    CommonDialog1.ShowColor
    ImgEdit1.SetSelectedAnnotationFillColor CommonDialog1.Color
End Sub