Set Focus On CheckListBox after Running Exe File

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Set Focus On CheckListBox after Running Exe File

Post: # 1252Post Darren
Sun May 29, 2016 8:36 am

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

AmkSoft
Posts: 4
Joined: Sat Jun 02, 2012 5:47 pm

Set Focus On CheckListBox after Running Exe File

Post: # 1253Post AmkSoft
Tue May 31, 2016 2:59 pm

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

Post Reply