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 - Make and Use Dialog Box

Now, we will make a dialog box to control a VKnife element's status: right-click the VKnife element, the dialog box will appear, select Status and click <OK> on this dialog box to change VKnife's status, the running interface might look like this:

Make and Use Dialog Box 1

Please follow these steps to make it.

1. Run Visual Graph IDE, click File -> Open library... menu item to open bin\controls.tbl as elements library, and then use GroupBox, RadioButton, Button and KeyManager elements in the controls group to design a dialog box as below:

Make and Use Dialog Box 2Open and Use Elements Library -> Make and Use Dialog Box 3

2. Select current sheet by click the blank, and then click Functions tab at left and double-click OnKeyDown function, write the following script:

KeyManager1.OnKeyDown( KeyManager1, Key )

Select <OK> button and write Close( 1 ) in its OnClick event; select <Cancel> button and write Close( 0 ) in its OnClick event.

3. Click Tools -> Document settings... menu item and make the following changes:

Make and Use Dialog Box 4

4. Save current document as h:\dlg.tbl.

5. Create a new file in IDE, click File -> Open library... menu item to open lib\power.tbl as elements library, and then use VKnife element in the power group to design current sheet as below:

Make and Use Dialog Box 5

Please note that you can change VKnife1 size by mouse.

6. Select VKnife1 and write the following code in its OnRButtonDown event:

' Create a dialog box.
doc = Create( "h:\dlg.tbl", false, false )
' Initialize the RadioButton's status.
doc.ActiveSheet.RadioButton1.Checked = Sender.IsOff
' Run the dialog box.
doc.ShowModal()
' IsOff is VKnife1's status property.
Sender.IsOff = doc.ActiveSheet.RadioButton1.Checked
' Free the memory.
doc.Free()


7. Click Program -> Run menu item or press <F9> to run this file, right-click the VKnife element, the dialog box will appear, select Status and click <OK> on this dialog box to change VKnife's status.

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