AnnNameOptions example for Visual Basic
Private Sub ExampleAnnSetNameOptions(hObject As Long)
RasterAnn.AnnEnumerate hObject, ANN_FLAG_RECURSE Or ANN_FLAG_NOTCONTAINER, ""
End Sub
Private Sub RasterAnn_OnAnnEnumerate(ByVal hObject As Long)
Dim ObjectType As AnnObjectType
RasterAnn.AnnNameOptions.Flags = ANN_NAME_ALL
RasterAnn.AnnGetNameOptions hObject
RasterAnn.AnnGetType hObject
ObjectType = RasterAnn.AnnType
If ObjectType = ANN_OBJECT_BUTTON Then
RasterAnn.AnnNameOptions.EnableShowName = False
RasterAnn.AnnNameOptions.AnnotationName = " Name Restricted"
RasterAnn.AnnNameOptions.EnableNameRestrict = False
RasterAnn.AnnNameOptions.EnableFontBold = False
RasterAnn.AnnNameOptions.EnableFontItalic = False
RasterAnn.AnnNameOptions.EnableFontStrikeOut = False
RasterAnn.AnnNameOptions.EnableFontUnderline = False
RasterAnn.AnnNameOptions.EnableNameBackTransparent = False
Else
RasterAnn.AnnNameOptions.EnableShowName = True
RasterAnn.AnnNameOptions.AnnotationName = " Name UnRestricted"
RasterAnn.AnnNameOptions.EnableNameRestrict = True
RasterAnn.AnnNameOptions.EnableFontBold = True
RasterAnn.AnnNameOptions.EnableFontItalic = True
RasterAnn.AnnNameOptions.EnableFontStrikeOut = True
RasterAnn.AnnNameOptions.EnableFontUnderline = True
RasterAnn.AnnNameOptions.EnableNameBackTransparent = True
End If
RasterAnn.AnnNameOptions.X = 10
RasterAnn.AnnNameOptions.Y = 10
RasterAnn.AnnNameOptions.FaceNameColor = RGB(0, 0, 0)
RasterAnn.AnnNameOptions.BackNameColor = RGB(255, 255, 255)
RasterAnn.AnnNameOptions.FontName = "Arial"
RasterAnn.AnnNameOptions.FontSize = 12
RasterAnn.AnnNameOptions.Flags = ANN_NAME_ALL
RasterAnn.AnnSetNameOptions hObject
End Sub