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 - Access Properties

Now we explain how to access element properties through a VB6 example.

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

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

3. Double-click Form1 and write the following code in Form_Load event:

Dim d as Object
' Create a new graph file and enter Design mode.
vgctrl1.Design ""
' Add a circle element to this file.
set d = vgctrl1.vg.ActiveSheet.AddUnit( nothing, "circle" )
d.SetBounds 10, 10, 32, 32
d.BackColor = 0


4. Write the following code in vgctrl1_OnDblClick event:

Dim d as Object
Set d = vgctrl1.vg.ActiveSheet.Units( 0 )
d.Width = 96
d.Height = 64
d.SetPropertyValue "BackColor", 255
MsgBox d.GetPropertyValue( "BackColor" )


5. Run this project and double-click the circle to observe effect.

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