SetSelectedAnnotationLineWidth Example VB

Example 1 allows the user to change the line width value in a text box.  It then updates a line control to illustrate the width, and uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation to the value entered in the text box control.

Example 2 allows the user to change the line width value using an UpDown control.  It then updates a line control to illustrate the width, and uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation.

Example 1

Private Sub txtWidth_Change()
    'On a form containing a text box and a line control,
    'this would allow the user to change the value in the
    'text box and then would update the line control (to
    'illustrate the width) and would also update the width
    'of a selected line annotation.
    Global intLineWidth as integer
    
    'Determine the width entered by user in the text box
    intLineWidth = Int(txtWidth.Text)
    'Set the width of the line control in the dialog box
    Line1.BorderWidth = intLineWidth
    'Set the width of the line annotation on the displayed
    'image
    frmMain.ImgEdit1.SetSelectedAnnotationLineWidth intLineWidth
End Sub

Example 2

Private Sub UpDown1_Change()
    'On a form containing a text box that is linked to an UpDown
    'control and a line control, this would allow the user to
    'scroll the UpDown control and would change the value in
    'the text box, the width of the sample line, and would also
    'update the width of a selected line annotation.

    'Determine the line width by the value of the UpDown
    'control
    intLineWidth = UpDown1.Value
    'Set the width of the "sample" line in the dialog box
    Line1.BorderWidth = intLineWidth
    'Set the width of the selected annotation line
    frmMain.ImgEdit1.SetSelectedAnnotationLineWidth intLineWidth
    
End Sub