Page 1 of 1

Set Focus On CheckListBox after Running Exe File

Posted: Sun May 29, 2016 8:36 am
by Darren
Can anybody help?

I have a ChackListBox that, every time I use the "UP" or "Down" arrow keys on the keyboard runs another application (Using the RUN command). If I don`t run this RUN command everything is OK and I can easily press the "UP" or "DOWN" keys and the CheckListBox operates fine.

However,

If I use the "RUN" command every time I use the "UP" or "Down" arrow keys on the keyboard, the "UP" or "Down" arrow keys on the keyboard do not work any more on the ChackListBox.

Is there any way I can reset the focus back onto the CheckListBox after using the "RUN" command????

I think that running an external exe file looses focus on the Form & the CheckListBox????

Many thanks in advance!!!!

Darren

Set Focus On CheckListBox after Running Exe File

Posted: Tue May 31, 2016 2:59 pm
by AmkSoft
Hi Darren,

thats right, the form loosen focus because you are giving the focus to an other program usung the RUN command.

What you could do is in the method where you do the run:
first store/remember what form/checkbox has the fosus now,
then do the RUN command.
After the RUN command has finnised set the focus on the stored/remembered form/checkbox.
You can dot this using the object.SetFocus method.
Probable the RUN with the NOACTIVATE parameter could al;so work.

I hope this helps a bit.

Grtz
Martie