Back to Home
Visual Graph Home
TriSun Software Inc. Home

Visual Graph Site Menu
Home
What is Visual Graph?
Screenshots
50 Technical Features
Getting Started
Abundant Graphic Libraries
File Format
FAQ
Online Demo (IE Only)
Common Applications
Visual Graph Getting Started
Use VG Component in Delphi 6
Use VG Component in VB6
Use Graphic Library
Change Element's Shape
Customize Property
Make Graphic Button
Get the Selected Elements
Dynamically Create Graph
Movable Label
Link Point
Access Properties
Use Line Vertexes
Call Windows API Functions
Call Visual Graph Functions
Callback Control Event in Script
Drag Graph in Run Mode
Detail Report
Make and Use Dialog Box

Visual Graph Getting Started - Callback Control Event in Script

As you know, Visual Graph allows you to declare functions in a .tbl file (via Program -> Add function... menu item), and you can call them in element's event script. Besides, it provides you with DoCommand and OnCommand matching callback mechanism.

DoCommand is a function in Visual Graph scripting language, it has two parameters, the first is current document, the second is a string that will be transfered to the document's related ActiveX control OnCommand event.

Now, we demonstrate it through a VB6 example.

1. Create a new file in Visual Graph IDE, and then draw a circle (basic element in library group) in this document.

2. Select this circle, and then double-click OnClick event in the Functions view at left to write the follow script:

DoCommand( Owner, "Hello" )

3. Save current document as h:\test.tbl.

4. Create a new project in VB6, right-click on Toolbox and select Components, and then check Visual Graph ActiveX Control and click <OK>.

5. Click vgctrl in Toolbox, and then draw an instance on Form1.

6. Write the following code in Form_Load event:

vgctrl1.Run "h:\test.tbl"

7. Write the following code in vgctrl1_OnCommand event:

MsgBox ACommand

8. Run this project, click the circle, you will get a message box with Hello prompt.


Sitemap | Legal Notices | Privacy Policy | Contact Us | About Us
Copyright© 2004-2017 TriSun Software Inc. All rights reserved.