Jump to content
Software FX Community

ChangeColor event


User (Legacy)
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...