SetupViewerForLineSelection Method

NI Vision for Visual Basic

SetupViewerForLineSelection Method

Syntax

CWMachineVision.SetupViewerForLineSelection Viewer

Return Type

Long

On success, this method returns 0. On failure, this function returns a negative number.

Purpose

Hides menu items in the pop-up menu of the given viewer so it displays only the tools needed to select a line.

Remarks

Use this method as an alternative to selecting the appropriate tools in the CWIMAQViewer property page.

Parameters

Viewer As CWIMAQViewer

The viewer that contains the pop-up menu to modify.

Example

Private Sub Run_Click()
    'After clicking on the Run button, the line is the only shape type
    'available, and the line tool is selected.
    CWMachineVision1.SetupViewerForLineSelection CWIMAQViewer1
End Sub

See Also

GetSelectedLineFromViewer

CWIMAQViewer.MenuItems

CWIMAQViewer.Tool