Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBox KeyPress Strange Behavior
Message
De
23/07/2004 10:03:51
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
ListBox KeyPress Strange Behavior
Divers
Thread ID:
00927344
Message ID:
00927344
Vues:
48
I have a listbox whose properties are:

controlsource=m.losspayitem
rowsource=left(lo_name,35),ltrim(lo_city)
rowsourcetype = 6 - fields
value = ''

Additional textboxes on the form have control sources of fields in the same table.

I also have textboxes on the form that display the corresponding record's other values not shown in the listbox. When the user presses the uparrow or dnarrown in the listbox, the textbox values are refreshed as they should be. Clicking on an item in the listbox refreshes the textbox values as they should be.

However, if the user is on a record that starts with 'A' (let's say ADAMS) and presses a letter to do a quicksearch in the listbox (such as 'G') and the listbox moves to the first record that begins with 'G' as it should (let's say the record is GANDER), the textboxes still show the previous value of ADAMS. If the user presses 'G' again, so now the listbox item is on the 2nd record that begins with the letter 'G' (let's say it is GMAC) then the textboxes change to reflect still the previous record of GANDER. They are always one behind but only when the user uses the quicksearch in the listbox and not when using the arrow keys to maneuver in the listbox or clicking on an item in the list.

In this case when the user presses a letter to do a quicksearch, the record pointer in the table is positioned on the correct record but the testboxes do not get refreshed correctly.

Code in the keypress event:
*listbox keypress
LPARAMETERS nKeyCode, nShiftAltCtrl

IF nKeyCode = 13 .OR. nKeyCode = -9
	NODEFAULT
	RETURN THISFORM.cmdOK.CLICK()
ENDIF

DODEFAULT()

RETURN this.click()
Code in the listbox click:
*listbox click
THISFORM.txtLoss_pay8.refresh()
thisform.txtloss_pay9.refresh()
thisform.txtloss_pay10.refresh()
thisform.txtloss_pay11.refresh()
thisform.txtrtrim_lo12.refresh()
DODEFAULT()
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform