Form.Show() does not accept keyboard keys

Posted by joey eisma on 03-Oct-2018 17:34

Hi,

On 10.2B08.

I have ABL window, with standard WAIT-FOR CLOSE OF THIS-PROCEDURE..

It calls a dialog box, that has 2 buttons. 1 button runs MyForm.cls with wait-for System.Windows.Forms.Application:Run(myObj) the other button me:Show(myObj).

MyForm.cls has 2 buttons just to test tabbing. 

With first button (wait-for system...), tabbing works as normal, however when called with Show(). it does not react to tabbing or hotkeys (alt key).

Any thoughts?

TIA!

All Replies

Posted by jquerijero on 03-Oct-2018 17:54

You will need an overall one and only Application:Run in your application. It is the one that sets up the message loop. Without it, .NET events will not work as expected.

Posted by joey eisma on 04-Oct-2018 09:22

Working around a legacy system, so trying to simulate as is.

However, I did as you mentioned, Form.Show() tab does not change focus. Nor the short cut keys.

Either way of implementing wait-for, the keypress event fires however, so my subject is not correct. Work around I'm thinking is code the tab event to change focus.

Posted by jquerijero on 04-Oct-2018 11:10

I don't believe you have to specially code for the tabbing event. There might be other complications for not using Application:Run() as the main message loop.

You can probably start your legacy main form in persistent mode, then the next line is the Application:Run(). I strongly suggest using one WAIT-FOR Application:Run().

This thread is closed