Create a KeyEventArgs Object
We use a custom function to set text in textboxes and in the function we verify that the value was set. For known cases--like dates, uppercase text, etc--we are anticipating the formatting to happen and so we expect that the textbox.text value will be formatted.
In most situations the formatting is triggered in either the OnLostFocus or OnLeave events. So in our function we call the OnLostFocus or OnLeave methods on the textbox in order to trigger the formatting code. I have a situation where string formatting for a textbox is triggered via the KeyDown event of the textbox only if the [Enter] key is pressed.
So my first thought is to try to simulate sending the [Enter] key to the OnKeyDown method of the textbox in order to simulate this and trigger the formatting code in the app. But after reading up on the KeyEventArgs class, I have not figured out how to create a 'key' object that represents the [Enter] key.
Has anyone found a workable way to create a 'key' object that could be used in scripts for a situation like this?
details:
TestComplete 12.0.122
VBScript project
AUT is a WinForms VB.NET app using Telerik controls
Thanks,
Daniel