Checking a User Dialog Box Entry

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 the EventLostFocus event to respond to the current values or texts of a control in a user dialog box. The user dialog box triggers the EventLostFocus event when a mouse click or a <Tab> moves the focus from a control.

Complete the following steps to check a user entry in a user dialog box:

  1. Select DIAdem SCRIPT.

  1. Select Edit»Create Dialog Box.

  2. Select View»Catalog.

  3. Click the OK and Cancel control group in the Catalog window and click and drag the group into the dialog box.

  4. Click the EditBox control on the Controls bar. 

  5. Drag open the control in the dialog box.

  6. Click the Events tab.

  7. Click ... in the EventLostFocus field on the Events tab. EditBox1 must be selected.

  8. Enter or copy the following text into the script editor:

    Sub EditBox1_EventLostFocus(ByRef This)
      If Not IsNumeric(This.Text) Then ' has the user entered a text
        Call MsgBoxDisp("No value")
        This.Text =""                  ' delete entry 
        This.SetFocus                  ' focus on EditBox
      End If
    End Sub
    Note  Add the above text to the lines generated automatically by the script editor.
  9. Select File»Save As and save the file as Test.sud.

  10. Select View»Test in DIAdem.

  11. Enable the textbox. Enter a text and press <Enter>.

    Note  The OK button is the default button because the Default=Yes property is set for this button. The default button is automatically selected if you press <Enter>.

    The user dialog box checks your entry and displays an error message. Click OK. The user dialog box deletes the existing entry and the focus returns to the textbox. Enter a numeric value and click OK.

  12. Close the user dialog box in DIAdem.

  13. Close the dialog editor.


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