GetSelectedAnnotationLineWidth Example VB

This example uses the GetSelectedAnnotationLineWidth method to determine the width of a selected line annotation.  It then updates a text box and a Line control to illustrate the width.

Private Sub Form_Load()
    'First, determine an annotation line's width and color. This is
    'then used in a dialog box which contains a sample line with a text
    'box to indicate the line width (in pixels) and an updown control
    'which is linked to the text box to allow the width to be
    'scrolled up and down. The user can change the width of the line
    'in the dialog box in order to change the width of the annotation.
    Dim intLineWidth As Integer
    Dim LineColor As OLE_COLOR
    
    'Get the line width and color to initialize the dialog box
    intLineWidth = frmMain.ImgEdit1.GetSelectedAnnotationLineWidth
    LineColor = frmMain.ImgEdit1.GetSelectedAnnotationLineColor
    
    'Set the current line width in the text box to the width of
    'the pixel width of the annotation mark.
    txtWidth.Text = Str(intLineWidth)
    'Set the value of the UpDown control to the current line width.
    UpDown1.Value = intLineWidth
    'Set the width of the sample line in the dialog box.
    Line1.BorderWidth = intLineWidth
    'Set the color of the sample line.
    Line1.BorderColor = LineColor
    'Display the dialog box.
    frmLineWidth.Show
End Sub