Responding to User Entries in User Dialog Boxes

DIAdem 2018 Help

Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)

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:

  1. Select the DIAdem SCRIPT panel.

  1. Select Edit»Create Dialog Box.

  2. Click the ComboBox control on the Controls bar.

  3. Drag open the control in the dialog box area.

  4. Click the column to the right of ListItems in the Properties tab. The ComboBox must be selected.

  5. The dialog editor opens the ListItems dialog box. Click Add twice and enter the names red and blue.

  6. Click OK.

  7. Select View»Script View to open the script editor. Enlarge the editor window if necessary.

  8. Select the event EventChange under ComboBox1 in the event tree of the script editor.

  9. 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.
  10. Select File»Save As and save the file as Test.sud.

  11. Select View»Test in DIAdem to test the functions of the user dialog box.

  12. 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.

  13. 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


Not Helpful