Hi
To display the checkboxes beside each series in the legend i do this;
theChart.Legend.CheckBoxes = true;
If the user selects a checkbox how do I detect this??
Thanks!
How detect when series checkbox is selected in the legend?
Re: How detect when series checkbox is selected in the legend?
Hello,
You can use the OnClickLegend event as follows:
You can use the OnClickLegend event as follows:
Code: Select all
Private Sub TChart1_OnClickLegend(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim i As Integer
Dim tmpX As Integer
Dim tmpY As Integer
If TChart1.Legend.CheckBoxes Then
tmpX = TChart1.Legend.Left + 5
For i = 0 To TChart1.SeriesCount - 1
tmpY = TChart1.Legend.Item(i).Top + 2
If (X >= tmpX) And (X <= tmpX + 10) And (Y >= tmpY) And (Y <= tmpY + 10) Then
MsgBox "Checkbox for Series " + Str$(i) + " clicked"
End If
Next i
End If
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How detect when series checkbox is selected in the legend?
Thanks Yeray. But unless Im mistake this code does not show whether a box is selected or deselected?
BTW. I meant to post this question on the .NET thread. So I will post there and link to your reply.
BTW. I meant to post this question on the .NET thread. So I will post there and link to your reply.
Re: How detect when series checkbox is selected in the legend?
Hi,
Here it is your thread in the .NET forum and the according reply:
http://www.teechart.net/support/viewtop ... =4&t=15196
Here it is your thread in the .NET forum and the according reply:
http://www.teechart.net/support/viewtop ... =4&t=15196
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |