|DIAdem 2017 Help|
|DIAdem 2018 Help|
|DIAdem 2019 Help|
|DIAdem 2020 Help|
|DIAdem 2020 SP1 Help|
Use events to respond to user entries in user dialog boxes. To change the background color of the user dialog box to the color you select in a ComboBox, and to display a message, complete the following steps:
Select the DIAdem SCRIPT panel.
Select Edit»Create Dialog Box.
Click the ComboBox control on the Controls bar.
Drag open the control in the dialog box area.
Click the column to the right of ListItems in the Properties tab. The ComboBox must be selected.
The dialog editor opens the ListItems dialog box. Click Add twice and enter the names red and blue.
Select View»Script View to open the script editor. Enlarge the editor window if necessary.
Select the event EventChange under ComboBox1 in the event tree of the script editor.
Enter or copy the following text into the script editor:
Sub ComboBox1_EventChange(ByRef This) If This.Value = 0 Then Dialog.Color = vbRed Call MsgBoxDisp("Red selected") ElseIf This.Value = 1 Then Dialog.Color = vbBlue Call MsgBoxDisp("Blue selected") End If End Sub
|Note Add the above text to the lines generated automatically by the script editor.|
|Note If you use the This object defined in the second line, you can rename controls in the user dialog box, without modifying the scripts. The dialog editor automatically refreshes the second line in the script when you rename the control.|
Select File»Save As and save the file as Test.sud.
Select View»Test in DIAdem to test the functions of the user dialog box.
Select an entry from the selection field in the user dialog box. The background color changes to the color you selected in the user dialog box. The user dialog box displays a message.
Close the user dialog box in DIAdem.
|Note You can use events to respond to almost all kinds of user entries, for example, to clicking a control or to moving a mouse. The user dialog box also executes events when it initializes and when it closes.|
Use the EventLostFocus event to respond to the current value or text of a control in a user dialog box. Use the events EventChange and EventClick of a control to refresh the controls of a user dialog box in relation to this control.
Analyzing and Displaying Channels Section by Section | Checking Dialog Box Entries | Dynamic User Dialog Box | Translating User Dialog Boxes | User Dialog Box for Entering Text and Numbers | User Dialog Box for Sequence Control | User Dialog Box in DIAdem VIEW | User Dialog Box in VIEW for the Calculation of the FFT and Harmonic Frequencies | User Dialog Box with Changing Background Color | User Dialog Box with Curve Preview | User Dialog Box with Extended Table | User Dialog Box with Internet Explorer | User Dialog Box with Scalable Table | User Dialog Box with Selection Lists | User Dialog Box with Selection Lists | User Dialog Box with Subdialog Boxes | User Dialog Box with Tables | User Dialog Box with Tree | Wizard for Tolerance Evaluation