>>Please excuse this simple question.. Can't find it in Bazian Book.
>>How do you force the focus of the space bar to an item on a form?
>>
>>I have a form with several buttons, the last one used has the focus. When I press the space bar, the one having focus triggers. I want the space bar to always do the one assigned button.
>>
>
>The space bar doesn't have focus per se - you'd either have to use SetFocus to direct VFP's focus to the default button you want to use, or capture the character received in the KeyPress() event and fire the desired button. The only keys that trigger specific actions are Enter (the Default action) and Escape (the Cancel action)
That's not true. In a command group, pressing space bar will trigger the action of the selected button. It will also select the current button in an option group and toggle the value of a checkbox.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer