There is no Keypress or Keydown events for TChart objects and the keypress events on the form do not fire when there is a TChart object active.
How can I capture keyboard events?
Detecting Keypress on chart
Hi Simon,
>How can I capture keyboard events?
To capture the keyboard events you can put a Command Button on a VB form, covering it with a TeeChart AX Control and then add similar code to the following (this will allow to remove the Series using the "delete" key) :
>How can I capture keyboard events?
To capture the keyboard events you can put a Command Button on a VB form, covering it with a TeeChart AX Control and then add similar code to the following (this will allow to remove the Series using the "delete" key) :
Code: Select all
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyDelete Then
TChart1.RemoveSeries 2
End If
End Sub
Private Sub Form_Load()
With TChart1
.Aspect.View3D = False
For i = 0 To 5
.AddSeries scLine
.Series(i).FillSampleValues 20
Next i
.Series(2).asLine.Pointer.Visible = True
End With
End Sub
Private Sub TChart1_OnAfterDraw()
Command1.SetFocus
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com