Hi , Whil:
Two ideas:
a) Keypreview on the form - set it to true
b) keypress event on the button
if nKeyCode = 13
this.value = i
endif
Untested
Regards
Rafael Copquin
----- Original Message -----
From: Whil Hentzen
To: [EMAIL PROTECTED]
Sent: Wednesday, May 07, 2008 3:06 PM
Subject: setfocus() not taking complete effect on cmd group
I'm building a form programmatically. Added a commandgroup with four
buttons via addobject. By default, the first button in the cmg has focus.
I pass an integer parm to the form identifying which of the four buttons
I want to have focus, and use that to drive setfocus() based on the number:
thisform.cmgButtons.button[i].setfocus()
When the form appears, the specified button looks like it has focus -
the marquis shows up on the appropriate button. cmgButtons.value returns
the value i, as it ought to.
If I click the button with the marquis, all is good. When I just press
the Enter key, though, the cmg.value property is always 1.
If I use the arrow keys to move to another button and then back to the
original button, and press Enter, cmg.value is now i.
So.... why is the Enter key not respecting the setfocus()'s value for
cmgButtons? Any ideas?
Whil
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.