Trouble setting default command button? 
Author Message
 Trouble setting default command button?

Guys,

I have a form with four command buttons. I set one of them to default, so
that it supposedly responds to the ENTER key. When I run the app, the
command button never has the focus when the form loads, and even if it is'nt
meant to, the ENTER button only activates the command button which currently
does have the focus. That is, the first one on the form I created. If I
double-click the default property of the command buttons to true, all other
switch to false, so I know the default property is being correctly handled
by VB. I'm setting the property at design time.

Any idea why setting my intended button default to true does not work as I
think it should?

Regards

Peter



Tue, 02 Apr 2002 03:00:00 GMT  
 Trouble setting default command button?
They default property works how you think except when a command button has
the focus.

If a textbox had focus and you pressed enter, it would fire the Default
command button click event.  However when another command button has focus,
its click event is fired when enter is pressed and not the default one.


Quote:
> Guys,

> I have a form with four command buttons. I set one of them to default, so
> that it supposedly responds to the ENTER key. When I run the app, the
> command button never has the focus when the form loads, and even if it
is'nt
> meant to, the ENTER button only activates the command button which
currently
> does have the focus. That is, the first one on the form I created. If I
> double-click the default property of the command buttons to true, all
other
> switch to false, so I know the default property is being correctly handled
> by VB. I'm setting the property at design time.

> Any idea why setting my intended button default to true does not work as I
> think it should?

> Regards

> Peter



Tue, 02 Apr 2002 03:00:00 GMT  
 Trouble setting default command button?
Peter have you set the tab order for the buttons on your form  this may be
your problem ?

Fred


Quote:
> Guys,

> I have a form with four command buttons. I set one of them to default, so
> that it supposedly responds to the ENTER key. When I run the app, the
> command button never has the focus when the form loads, and even if it
is'nt
> meant to, the ENTER button only activates the command button which
currently
> does have the focus. That is, the first one on the form I created. If I
> double-click the default property of the command buttons to true, all
other
> switch to false, so I know the default property is being correctly handled
> by VB. I'm setting the property at design time.

> Any idea why setting my intended button default to true does not work as I
> think it should?

> Regards

> Peter



Tue, 02 Apr 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Default Command Button

2. Command Button Default property problem

3. Default command buttons bypassing LostFocus

4. Command Button 'Default' Property

5. Default property of command button is ignored VB5(SP2/3)

6. Masked Edit box inhibits command button default property

7. Intellimouse / mouse: Auto point to default command button

8. Change Default command button Font?

9. 3D Command Button: No Default?

10. 3D Command Button: No Default?

11. HELP - Command Buttons on default form

12. Default Property of Command Button

 

 
Powered by phpBB® Forum Software