Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Rick C. Hodgin
  Where is Rick C. Hodgin?
 Indianapolis
 Indiana - United States
 Rick C. Hodgin
 Tags
Subject: RE: Enter on TextBox triggers Command.Click
Thread ID: 365621 Message ID: 365628 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Classes and Objects
Date: Friday, December 28, 2012 7:42:18 PM         
   


> > Colleagues,
> >
> > I've never seen such behavior: I hit Enter on a data entry box - and it triggers Click event on a Command button - how comes?!
> >
> > I made this button (and all other ones) non-TabStoppable - and it still does it!
> > I put in the following code
> >
> >
IF m.nKeyCode==13
> >    THIS.SetFocus
> > ENDIF ()

> > into this textbox's KeyPress event - and it still does it! :-@
> >
> > Where am I to look for the cause of this behavior?
> >
> > Regards,
> >
> > Ilya
>
>
>
> SET STEP ON in the KeyPress event of the data entry box (editbox/textbox??) and then track where control goes. There may be some parent class behavior that's executing.
>
> Best regards,
> Rick C. Hodgin

Did that, ain't got any wiser: with IF nKeyCode==13 SET STEP ON, it did not go to any of the buttons, but the focus stayed solidly on the text box...

Any other ideas, pretty please?

Regards,

Ilya

P.S. 2+ hours later: it seems that this behavior is somehow tied with the TabStop property of the command buttons. Once I disabled that Tab Stop feature for all the editing command buttons - it stopped doing what it had been doing on the Enter.
So, the issue is resolved ( (yippee) ), but the true cause still remains a mystery... :-|

ENTIRE THREAD

Enter on TextBox triggers Command.Click Posted by Ilya Rabyy @ 12/28/2012 6:30:21 PM
RE: Enter on TextBox triggers Command.Click Posted by Rick Hodgin @ 12/28/2012 6:51:19 PM
RE: Enter on TextBox triggers Command.Click Posted by Ilya Rabyy @ 12/28/2012 7:42:18 PM
RE: Enter on TextBox triggers Command.Click Posted by David Mustakim @ 12/28/2012 11:53:16 PM
RE: Enter on TextBox triggers Command.Click Posted by tushar @ 12/29/2012 5:23:08 AM
RE: Enter on TextBox triggers Command.Click Posted by Samir H. @ 12/29/2012 7:15:35 AM