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 - Make and Use Dialog BoxNow, 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:
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:
Open and Use Elements Library ->
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:
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:
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.
' IsOff is VKnife1's status property.
Sender.IsOff = doc.ActiveSheet.RadioButton1.Checked
' Free the memory.
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.
Legal Notices |
Contact Us |
Copyright© 2004-2017 TriSun Software Inc. All rights reserved.