Page 1 of 1
Anything in ActiveX to work like .NET's ColorLine events?
Posted: Fri Feb 20, 2004 3:06 pm
by 6926650
.NET TeeChart has DragLine and EndDragLine events for Steema.TeeChart.Tools.ColorLine. I can't seem to find anything that will work when i move a colorline in ActiveX 6. Any help?
Posted: Mon Feb 23, 2004 9:55 am
by Pep
Hi,
There are no TeeChart events associated with the ColorLine Tool. The movement of it can be tracked, however - see my code below for how to do this.
Code: Select all
Dim MyX As Long
Dim Go, Start As Boolean
Private Sub Form_Load()
Start = True
With TChart1
.Aspect.View3D = True
.Aspect.Chart3DPercent = 100
.AddSeries scLine
.Series(0).FillSampleValues 100
.Tools.Add tcColorLine
.Tools.Items(0).asColorLine.Axis = .Axis.Bottom.AxisType
.Tools.Items(0).asColorLine.AllowDrag = True
.Tools.Items(0).asColorLine.Value = 30
.Tools.Items(0).asColorLine.DragRepaint = True
.Tools.Items(0).asColorLine.Pen.Visible = False
End With
End Sub
Private Sub TChart1_OnAfterDraw()
With TChart1
If Go = True Then
.Canvas.Brush.Color = vbYellow
.Canvas.BackMode = cbmOpaque
.Canvas.Plane3D MyX, .Axis.Top.Position, MyX, .Axis.Bottom.Position, 0, .Aspect.Width3D
End If
If Start = True Then
If MyX = 0 Then
MyX = .Series(0).CalcXPosValue(30)
End If
.Canvas.Brush.Color = vbYellow
.Canvas.BackMode = cbmOpaque
.Canvas.Plane3D MyX, .Axis.Top.Position, MyX, .Axis.Bottom.Position, 0, .Aspect.Width3D
Start = False
End If
End With
End Sub
Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton,
ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
With TChart1
If .Tools.Items(0).asColorLine.Clicked(X, Y) = True Then
Go = True
End If
End With
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState,
ByVal X As Long, ByVal Y As Long)
If Go = True Then
MyX = X
MyY = Y
TChart1.Repaint
End If
End Sub
Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton,
ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If Go = True Then
Go = False
TChart1.Repaint
End If
If Start = False Then
Start = True
TChart1.Repaint
End If
End Sub