Hello Support Team,
I have one asTeeCursor and property FollowMouse is True. I want to disable this cursor on Double Click. How do it ? Disabled cursor can't move and cursor pointer should not change.
Best regards, Rustam.
Disable TeeCursor.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rustam,
You can implement something like that on TeeChart's OnDblClick event doing something like this:
You can implement something like that on TeeChart's OnDblClick event doing something like this:
Code: Select all
Private Sub TChart1_OnDblClick()
TChart1.Tools.Items(0).Active = Not TChart1.Tools.Items(0).Active
'or
'TChart1.Tools.Items(0).asTeeCursor.FollowMouse = Not TChart1.Tools.Items(0).asTeeCursor.FollowMouse
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Wrong
It is not correct. In first case (Active=False) the cursor disappears absolutely. In second case (FollowMouse=False) cursor pointer changes when it's on the line of asTeeCursornarcis wrote:Hi Rustam,
You can implement something like that on TeeChart's OnDblClick event doing something like this:
Code: Select all
Private Sub TChart1_OnDblClick() TChart1.Tools.Items(0).Active = Not TChart1.Tools.Items(0).Active 'or 'TChart1.Tools.Items(0).asTeeCursor.FollowMouse = Not TChart1.Tools.Items(0).asTeeCursor.FollowMouse End Sub
Rustam.
Hi Rustam,
yes, in that case if you want to hide the mouse cursor the only way I can think of is by using the Canvas techniques to simulate a cursor. This will allow you to customize the aspect and enable or disable ti when you want.
An example of cursor using the canvas could be :
yes, in that case if you want to hide the mouse cursor the only way I can think of is by using the Canvas techniques to simulate a cursor. This will allow you to customize the aspect and enable or disable ti when you want.
An example of cursor using the canvas could be :
Code: Select all
Private Sub Form_Load()
TChart1.Series(0).FillSampleValues 20
TChart1.Series(1).FillSampleValues 20
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim xx, yy, i
Dim InChart As Boolean
xpos = X
ypos = Y
InChart = True
With TChart1
'Optionally use .Aspect.Width3D and Height3D to set Line to plane of Series
'in a 3D Chart - recommend use of 2D for simplicity
If X <= .Axis.Left.Position Then
X = .Axis.Left.Position + 1
InChart = False
LastValueY = 0
End If
If X > .Axis.Right.Position Then
X = .Axis.Right.Position - 1
InChart = False
LastValueY = .Series(0).Count - 1
End If
.Canvas.Brush.Style = bsClear
.Repaint
If .SeriesCount > 0 Then
For s = 0 To .SeriesCount - 1
If .Series(s).Count > 0 Then
If InChart = True Then
For i = .Axis.Top.Position To .Axis.Bottom.Position
If .Series(s).Clicked(X, i) <> -1 Then
Exit For
End If
Next i
.Canvas.TextOut 10, 10 + (10 * s), "Series " & s & " Value: " & CInt(.Series(s).YScreenToValue(i))
Else
.Canvas.TextOut 10, 10 + (10 * s), "Series " & s & " Value: " & CInt(.Series(s).YValues.Value(LastValueY))
End If
End If
Next s
End If
'.Canvas.Pen.Style = psDot
'.Canvas.Pen.Color = vbWhite
.Canvas.Pen.Color = vbBlue
.Canvas.MoveTo X, .Axis.Top.Position
.Canvas.LineTo X, .Axis.Bottom.Position
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com