|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:
Select DIAdem SCRIPT.
Select Edit»Create Dialog Box.
Click the OK and Cancel control group in the Catalog window and click and drag the group into the dialog box.
Click the EditBox control on the Controls bar.
Drag open the control in the dialog box.
Click the Events tab.
Click ... in the EventLostFocus field on the Events tab. EditBox1 must be selected.
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.|
Select File»Save As and save the file as Test.sud.
Select View»Test in DIAdem.
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.
Close the user dialog box in DIAdem.
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