Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 tushar Kanvinde
 To: David Hall
  Where is David Hall?
 United Kingdom
 David Hall
Subject: RE: list box selection
Thread ID: 143496 Message ID: 143646 # Views: 2 # Ratings: 0
Version: Visual FoxPro 7 Category: Classes and Objects
Date: Thursday, August 30, 2007 2:04:16 PM         

> >
> > David
> >
> > InteractiveChange is fired when a user makes a change in the value even if the control does not loose focus. In a textbox, it will fire for every character you type or delete.
> >
> > ProgrammaticChange is fired when some code changes the value. So if the lostfocus of another control changes the value of your control, the programmatic change will be fired.
> >
> > Valid event is fired when the user changes the value and then the control looses control.
> >
> > LostFocus is fired when the control looses control.
> >
> > I think you should also call the method from the ProgrammaticChange event.
> >
> > Regards
> > Tushar
> No good Tushar, none of the events you mention fire. The interactive change does not fire if the value does not change. Neither does 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. The programmatic change does not fire if all the user is doing is keyboard or mouse to select another value in a drop-down list box.
> 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.


Could you run this code

PUBLIC oform1


DEFINE CLASS form1 AS form

DoCreate = .T.
Caption = "Form1"
Name = "Form1"

ADD OBJECT combo1 AS combobox WITH ;
Height = 24, ;
Left = 120, ;
Style = 2, ;
Top = 36, ;
Width = 204, ;
Name = "Combo1"



PROCEDURE combo1.InteractiveChange
wait wind transform(this.value+' Interactive Change') nowait

PROCEDURE combo1.ProgrammaticChange
wait wind transform(this.value+' Programmatic Change') nowait


This should create a programmatic change during the init event and then interactivechange every time you move.



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