03-23-2011 05:08 AM
03-23-2011 10:24 AM
Hi BLV,
I usually use the "EventLostFocus" callback, which works well with the "Tab" key. I poked around in the EditBox properties, though, and discovered that you can monitor the "CurrentLine" property in the "EventChange" callback:
Sub EditBox1_EventLostFocus(ByRef This) 'Created Event Handler Dialog.OK End Sub Sub EditBox1_EventChange(ByRef This) 'Created Event Handler IF EditBox1.CurrentLine > 1 THEN Dialog.OK End Sub
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-24-2011 04:43 AM
Thank you, Brad for your quick response. I was able to get the Enter key to work as required, in the Edit box. But the only trade off to make it function, was that the height of the text box had to be increased to enable the cursor to move to the next line on hitting Enter key!! Otherwise, the Enter key press was not being recognized!!
03-24-2011 05:06 AM - edited 03-24-2011 05:11 AM
You can also use the IsKeyPressed function. I think it is new in DIAdem 2010.
Sub EditBox1_EventChange(ByRef This)
If IsKeyPressed(&H0D) THEN Dialog.OK
End Sub
You will have the same problem if you have only one line, but you can change the property "VerticalScroll" to 2 (Yes No Scrollbars)