Can the focus on a Form be controlled by a program?
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
6 posts
• Page 1 of 1
Can the focus on a Form be controlled by a program?
Examples would be appreciated....
- ArrayMac227
- Posts: 62
- Joined: Sat Sep 12, 2015 1:40 pm
- paulmansour
- Posts: 420
- Joined: Fri Oct 03, 2008 4:14 pm
Re: Can the focus on a Form be controlled by a program?
Knew that already... are there other means?
In the expression I use, my 'Object' is a Button. Is that a problem?
In the expression I use, my 'Object' is a Button. Is that a problem?
- ArrayMac227
- Posts: 62
- Joined: Sat Sep 12, 2015 1:40 pm
Re: Can the focus on a Form be controlled by a program?
You ask a question, get an answer and then point out that you knew already.
Who else is going to answer I wonder.
Who else is going to answer I wonder.
-
kai - Posts: 137
- Joined: Thu Jun 18, 2009 5:10 pm
- Location: Hillesheim / Germany
Re: Can the focus on a Form be controlled by a program?
Hi ArrayMac227,
You could also do it with ⎕NA and the win32 windows function.
Regards,
Vince
You could also do it with ⎕NA and the win32 windows function.
'f' ⎕WC 'form'
'f.b' ⎕WC 'button'
⎕NA 'P user32.dll|SetFocus P'
r←SetFocus f.e.Handle
Regards,
Vince
- Vince|Dyalog
- Posts: 413
- Joined: Wed Oct 01, 2008 9:39 am
Re: Can the focus on a Form be controlled by a program?
Thanks to Vince for the reply. This bolsters my theory that setting the focus is problematic in my specific case:
. create a form;
. add an HTMLRenderer control, br,
. add an Ok Button: bnOk,
. Set the Default to 1 on bnOk
. add a Cancel Button: bnCx
. Set the Cancel to 1 on bnCx
. Set the Focus on bnCx,
. put a ⎕DQ on the form.
The expectation is that a press of Esc will close the form. Doesn't happen.
It _does_ work when Edit is substituted for HTMLRenderer.
A workaround: Alt+Tab, Alt+Tab to switch out and back into the Form does enable the Esc.
. create a form;
. add an HTMLRenderer control, br,
. add an Ok Button: bnOk,
. Set the Default to 1 on bnOk
. add a Cancel Button: bnCx
. Set the Cancel to 1 on bnCx
. Set the Focus on bnCx,
. put a ⎕DQ on the form.
The expectation is that a press of Esc will close the form. Doesn't happen.
It _does_ work when Edit is substituted for HTMLRenderer.
A workaround: Alt+Tab, Alt+Tab to switch out and back into the Form does enable the Esc.
- ArrayMac227
- Posts: 62
- Joined: Sat Sep 12, 2015 1:40 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group