SnapMode Property

Measurement Studio User Interface

SnapMode Property

Syntax

CWAnnotation.SnapMode

Data Type

CWCursorSnapModes

You can use the following constants with this data type:

  • cwCSnapAnchoredToPoint–Snaps the cursor or annotation to a specified point on a specific plot. The cursor or annotation cannot be moved.
  • cwCSnapFixed–Sets the cursor or annotation position independent of any plot. The cursor or annotation cannot be moved.
  • cwCSnapFloating–Sets the cursor or annotation independent of any plot. You can move the cursor or annotation anywhere in the graph area.
  • cwCSnapNearestPoint–Snaps the cursor or annotation to the nearest point on any plot. You can move the cursor or annotation along any plot.
  • cwCSnapNearestYForFixedX–For a fixed X location, the cursor's Y value is the Y value of the nearest point on the specified plot. For an annotation cwCSnapNearestYForFixedX is equivalent to cwCSnapPointsOnPlot. The cursor or annotation can be moved only along this plot.
  • cwCSnapPointsOnPlot–Snaps the cursor or annotation to points on a specified plot. The cursor or annotation can be moved only along this plot.

Purpose

Specifies if the annotation's shape is centered around the plot point defined by the Plot and PointIndex properties and how the shape is dragged by the mouse.

Remarks

If you set SnapMode to cwCSnapFloating, the shape is drawn at the values specified by CWShape.XCoordinates and CWShape.YCoordinates, and you can move the entire annotation anywhere in the graph area. If you set SnapMode to cwCSnapPointsOnPlot, the shape is centered around the plot point defined by the Plot and PointIndex properties, and you can move the shape along the plot.

Example

'Anchor the second annotation to the specified plot at point 25
CWGraph1.Annotations.Item(2).Plot = CWGraph1.Plots(1)
'Remember that PointIndex is zero-based
CWGraph1.Annotations.Item(2).PointIndex = 24
CWGraph1.Annotations.Item(2).SnapMode = cwCSnapPointsOnPlot

See Also

CWAnnotation.Plot

CWAnnotation.PointIndex

CWShape

CWShape.XCoordinates

CWShape.YCoordinates