SetSelectedAnnotationLineColor Example VB

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line 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 SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

Private Sub cmdLineColor_Click()
    'This example uses the Microsoft color dialog box to
    'change a selected annotation mark's line color.
    Dim LineColor As Long
    
    'Determine the current color of the selected annotation
    'mark and init the dialog box color property to that color.
    LineColor = ImgEdit1.GetSelectedAnnotationLineColor
    CommonDialog1.Color = LineColor
    CommonDialog1.Flags = cdlCCRGBInit
    CommonDialog1.ShowColor
    ImgEdit1.SetSelectedAnnotationLineColor CommonDialog1.Color
End Sub