Jump to content
Software FX Community

ChangeColor event


User (Legacy)

Recommended Posts

Hi

The chart_ChangeColor event gets fired when I change the colour of a

series(0) on the chart. However, if I try to read the colour the user has

chosen I get the colour that the serie was before the change took place!!

So if the line is yellow (rgb - 65535) and I change it to Magenta (rgb -

16711935) then from within the chart_ChangeColor event - I still get when I

read the chart.Series(0).Color property the previous colour (65535).

How can I overcome this??

Cheers

Marcel Heeremans

************* sample code *******************

Private Sub chart_ChangeColor(ByVal nType As Integer, ByVal nIndex As

Integer, nRes As Integer)

Dim vTemp As Variant

If nType = 3 Then

vTemp = chart.Series(0).Color

Debug.Print "changecolour: " & vTemp

momoa.ColourLine = vTemp

End If

End Sub

Link to comment
Share on other sites

This is by design. The ChangeColor event is fire BEFORE the color is changed

so that you can prevent the change (you many want to prevent some series or

elements from changing colors).

You need to delay to AFTER the event is completed to obtain the new color.

The easies way to do this in VB will be to create a Timer, enable it when

the event is received and process the color changed when the timer is fired.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...