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

Message ListMessage List     Post MessagePost Message

  Zooming and Scrolling with Track Line
Posted by Jeff on Jan-10-2020 15:02
Attachments:
Hello,

I'm a beginner and I learn the use of ChatDirector.

I work with Visual Studio 2019, under C#, with .NET Framework 4.5.

Before I buy, I test and learn. I try all the code examples present on the ChartDirector website.

All the examples work as expected, until I have a problem with the code of "Zooming and Scrolling with Track Line (1) (Windows)":

https://www.advsofteng.com/doc/cdnet.htm#zoomscrolltrack.htm

The compilation mentions errors on the following lines:

pointerPB.Checked = true;

hScrollBar1.Enabled = winChartViewer1.ViewPortWidth < 1;

How should I define pointerPB and hScrollBar1 (unknown and underlined in red in the code editor)?

It seems they are no suitable properties or controls to define these objects in Visua Studio 2019.

Thank you for your answer.

Jeff
errors.jpg

  Re: Zooming and Scrolling with Track Line
Posted by Peter Kwan on Jan-10-2020 18:44
Hi Jeff,

Did you copy the code from the documentation on our web site?

Please do not just copy the code. Instead, please open the Visual Studio solution "ChartDirectorNetWinChartsNetWinCharts.sln". It includes all the examples in our documentation and can be compiled and run directly.

It is because in Windows Forms, Visual Studio will automatically generate some code when you use the designer. For example, when you open a Form, and drag a TextBox control to the Form and set its properties, Visual Studio will automatically generate some code in a "designer file" that you may not notice. There can also be a resource file for resources (such as images or icons) used in the Form.

Our documentation only lists out human written code. The purpose is to explain how to write code that use ChartDirector. It does not include the designer or resource files. If you do not have those files, the code would not compile.

For your information, the pointerPB and hScrollBar1 are controls that we drag onto the Form. They are defined in the designer file.

If you use our Visual Studio solution, it will include all files. You can also see how the controls are layout in the Form and their properties.

Regards
Peter Kwan

  Re: Zooming and Scrolling with Track Line
Posted by Jeff on Jan-16-2020 18:54
Hello,

OK, thank you Peter for your detailed explanation.

All is fine now.

I buy CharDirector.