Back to Home
Visual Graph Home
TriSun Software Inc. Home
Visual Graph Site Menu
What is Visual Graph?
50 Technical Features
Abundant Graphic Libraries
Online Demo (IE Only)
Visual Graph Getting Started
Use VG Component in Delphi 6
Use VG Component in VB6
Use Graphic Library
Change Element's Shape
Make Graphic Button
Get the Selected Elements
Dynamically Create Graph
Use Line Vertexes
Call Windows API Functions
Call Visual Graph Functions
Callback Control Event in Script
Drag Graph in Run Mode
Make and Use Dialog Box
Visual Graph Getting Started - Change Element's ShapeThe following example demonstrates how to change the element's shape.
1. Run ide.exe, draw 3 rectangles like this:
We name them as A, C, B from left to right by changing their Name property.
2. Now, select these 3 rectangles, right-click them and execute Merge element to merge them.
We try to stretch this merged element by mouse, its shape will be changed, like this:
By default, the element will keep the ratio of its inner elements when changing its shape.
3. If we want to stretch it like the following shape, that is, do not change A, just only move B to stretch C, how to do?
Please right-click this element and execute Edit element (by default, Visual Graph IDE will open a new document that named .element1 for editing its inner elements), and then click Functions tab at left, double-click OnResize, write the following script:
A.SetBounds( Left, Top, A.Width, Height )
B.SetBounds( Right - B.Width, Top, B.Width, Height )
C.SetBounds( A.Right, Top + Height / 2 - C.Height / 2, Width - A.Width - B.Width, C.Height )
Now, switch to the original document (noname), just stretch the merged element by mouse, the script will be executed in the Design mode.
Legal Notices |
Contact Us |
Copyright© 2004-2017 TriSun Software Inc. All rights reserved.