Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: David Hall
  Where is David Hall?
 Birmingham
 United Kingdom
 David Hall
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: list box selection
Thread ID: 143496 Message ID: 143623 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Classes and Objects
Date: Thursday, August 30, 2007 12:03:57 PM         
   


> > My problem is this could all work better. For example, if the user re-selects the same payment type, the interactive change does not fire and the focus remains in the list-box. ALSO the first time the list-box is changed the interactive change event fails to fire. I dont understand this - at the first change, the interactive change fails to fire, but it then always fires as expected afterwards and the card number text box gets the focus as expected. Why not the first time?
> >
> > What I would like is that the card text box ALWAYS receives the focus immediately after the drop-down list-box is 'selected' EVEN IF the value does not change. How can I do this?
>
> David,
>
> I take it that you have a custom method that contains the code to change the formatting of the card textbox, etc. and you call this method from the combo's .InteractiveChange() event. I would recommend that you move your method call to the .LostFocus() event. This event always fires when focus moves from the combo whereas the .InteractiveChange() event may not fire (there may be no changes to the value of the combo.) Also, you may want to explicitly tell your app to move the focus from the combo to a specific textbox (or what ever.) Take a look at the .SetFocus() method in help. ThisForm.MyTextbox.SetFocus()
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)

No good Ken, 'the interactive change may not fire'. So the is NOT the right place to put the code to change the formatting as you say. Neither is the lost focus, though, because for whatever reason, a drop-down list box does not loose the focus under any circumstances except the user physically selecting another object with mouse or keyboard. This is NOT what is wanted.

My solution is to put the reformatting code in the Valid clause, and add a KEYBOARD '{TAB}' which forces the credit card box to get the focus whatever the user does to select a drop-down value, even when no change is made.

ENTIRE THREAD

list box selection Posted by David Hall @ 8/29/2007 10:58:43 AM
RE: list box selection Posted by Ken Murphy @ 8/29/2007 1:15:14 PM
RE: list box selection Posted by David Hall @ 8/30/2007 12:03:57 PM
RE: list box selection Posted by tushar @ 8/29/2007 1:28:24 PM
RE: list box selection Posted by David Hall @ 8/30/2007 12:07:38 PM
RE: list box selection Posted by tushar @ 8/30/2007 2:04:16 PM
RE: list box selection Posted by David Hall @ 8/30/2007 10:05:50 PM
RE: list box selection Posted by tushar @ 8/30/2007 10:36:38 PM