Tool example for Visual Basic
'This sample displays the current tool, and then changes it to ANN_TOOL_RECT
Private Sub Tool_Click()
Dim strTool As String
strTool = RasterAnnToolbar.Tool
Select Case RasterAnnToolbar.Tool
Case ANN_TOOL_SELECT:
strTool = "Select"
Case ANN_TOOL_LINE:
strTool = "Line"
Case ANN_TOOL_RECT:
strTool = "Rect"
Case ANN_TOOL_ELLIPSE:
strTool = "Ellipse"
Case ANN_TOOL_POLYLINE:
strTool = "Polyline"
Case ANN_TOOL_POLYGON:
strTool = "Polygon"
Case ANN_TOOL_POINTER:
strTool = "Pointer"
Case ANN_TOOL_FREEHAND:
strTool = "Freehand"
Case ANN_TOOL_HILITE:
strTool = "hilite"
''...other tools
End Select
MsgBox "Current tool: " & strTool
MsgBox "Changing to ANN_TOOL_RECT"
RasterAnnToolbar.Tool = ANN_TOOL_RECT
End Sub