Text Box Requires Return Keystroke

On some GUIs, the Enter/Return key must be pressed after data is entered into a text box. Suppose you want to create a test case that enters invalid data into the text box, and then checks if the application detects the error. After the test case enters the invalid data, it needs to use the GetGUIType function to determine the GUI, and then press the Return key if the GUI requires it.

For example:

// code to enter an invalid string into field
if (GetGUIType () == mswnt)
   MyTextField.TypeKeys ("<Return>")
// code to verify that application detected error