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 - Movable Label

The following graph has a label, and there is a point on this label. Drag this point can change the label position.

Movable Label

Please follow these steps to make it.

1. Create a new file in Visual Graph IDE, and place a HSwitch element (open library file lib\power.tbl first) on sheet1.

2. This element has not any label, we can improve it.

3. Right-click on HSwitch1 and execute Edit element, a new document will appear, now we have already entered the inner of HSwitch1 (.HSwitch1 document).

4. Draw a rectangle (basic element rect in library group) under Rect1 in .HSwitch1 document, and then set its LineType = 0, Pattern = 0, Text = Label.

5. Place a controlpoint basic element (in library group) in the center of above rectangle.

6. Select this point, double-click its OnNodeChange event (first one) in Functions view, and write the following code:

Rect2.MoveTo(Sender.X[0]-Rect2.Width/2,Sender.Y[0]-Rect2.Height/2)

7. Select above rectangle and controlpoint, set their Locked = true.

8. Save .HSwitch1 document and close it. In fact, it only update HSwitch1 element, no file was saved.

9. Now, in the Design mode, you can move whole element (with the label), and can move the controlpoint to move the label.

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