I am setting a lable in the paintmarker event using annotation text for each bar in my chart. Using the following code:
Set chLabel(i) = AnnotX.Add(OBJECT_TYPE_TEXT)
With chLabel(i)
.Attach ATTACH_NONE, Null
.Text = "####"
.Font.Size = 10
.height = ChartFX1.height
.width = ChartFX1.width
.SizeToFit
.Left = x
.Top = y
.Refresh False
End With
This works greate but the PaintMarker Event will not stop from firing off. I have tried to set it off by reseting the TypeMask after processing all bars in the chart, but that doesn't seem to work. Why is the PaintMarker Event still firing off?
ChartFX1.TypeMask = ChartFX1.TypeMask And Not CT_PAINTMARKER
Private Sub ChartFX1_PaintMarker(ByVal x As Integer, ByVal y As Integer, _
ByVal lPaint As Long, ByVal nSerie As Integer, _
ByVal nPoint As Long, nRes As Integer)
lngHDC = ChartFX1.PaintInfo(CPI_GETDC)
Call SetChartLabel(nPoint, x, y)
ChartFX1.PaintInfo CPI_RELEASEDC, lngHDC
end sub