ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Track Cursor and MouseMovePlotArea of ChartDirector 7.0 (ASP/COM/VB Edition)
Posted by C.H. Gim on Sep-09-2022 13:06
How to support Track Cursor and MouseMovePlotArea in ChartDirector 7.0 (ASP/COM/VB Edition) for VB (for Not jsChart) ?

  Re: Track Cursor and MouseMovePlotArea of ChartDirector 7.0 (ASP/COM/VB Edition)
Posted by Peter Kwan on Sep-12-2022 02:08
Hi C.H. Gim,

Since you mentioned about ASP/COM/VB, I assume the "VB" refers to classical VB (such as "VB6" or "VBA") which is based on the COM technology, not the VB in the .NET framework.

(If you are using Visual Studio 2002 or later, the VB refers is based on the .NET framework, and you should use ChartDirector for .NET instesad of ChartDirector for ASP/COM/VB.)

As VB6 is no longer supported by Microsoft for a long time, it lacks many user interaction features. For example, it does not have a "mouse out" or "mouse wheel" events. It makes it difficult to implement the full ChartDirector user interaction support. That's why we have not ported the some of the user interaction features to VB6.

For your case, for the Track Cursor and MouseMovePlotArea, it is easy to implement with your own code.

For the MouseMovePlotArea, simply handle the VB6 mouse move event. The VB6 mouse move event will provide you the mouse coordinates specified in the scaleMode property. You can use the VB6 ScaleX function to change it to pixel units. Then you can easy check if it is inside the plot area rectangle.

For the Track Cursor, simply redraw the chart if the mouse is moving inside the plot area. The chart drawing code should include drawing the track cursor.

I happened to have a simple VB6 example that can demonstrate the track cursor. You can download it below:

https://www.advsofteng.com/support/vb6_simplezoomscrolltrack.zip

Inside, there is a single file "frmSimpleZoomScroll.frm". Please add it to your VB6 project, and then add a push button to display the form (by using frmSimpleZoomScroll.Show).

Best Regards
Peter Kwan