Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox problem
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01077137
Message ID:
01077194
Vues:
39
This message has been marked as the solution to the initial question of the thread.
>>>>I'm not sure I want to move the code into LostFocus. I also found that _incseek setting has no effect on the behavior (as I suspected). I'm not sure if there is a solution for the problem, I'm afraid - there is not.
>>>
>>>You may try CHRSAW() or KeyPress to see if there're keystrokes pending
>>
>>CHRSAW doesn't seem to work and I'm not sure what can I do in KeyPress. The only solution I found so far (but it's ugly) is to return 1 in my do case. In other words, as long as I fire a message I move focus out of the combobox.
>
>You may try to set flag (a property) in KeyPress(), check it and reset in Valid(). I'm not sure if it'll work by you can try.

Ok, here is how I "solved" the problem, see, if there are possible problems:

Valid event:
local lcPK
this.AddProperty("lRemain", .f.)
lcPK = this.value
	with this.parent
		.cboCarrier_Branches.rowsource = ""
		.Carrier_Branches_Merge_biz1.Set_fk(m.lcPK)
		.Carrier_Branches_Merge_biz1.requery(.t.,'crsCarrier_branches_All_merge')

		.cboCarrier_Branches.rowsourcetype = 2
		.cboCarrier_Branches.rowsource = 'crsCarrier_branches_All_merge'
		.cboCarrier_Branches.requery()
		.cboCarrier_Branches.enabled = .t.
		do case
		case reccount('crsCarrier_branches_All_merge') = 1
			=ErrorMsg("The carrier " + alltrim(.cboCarriersToSelect.displayvalue) + ;
				" has only 1 branch")
			this.lRemain = .t.	
			RETURN 1 && Otherwise typing new sequence doesn't work
		case reccount('crsCarrier_branches_All_merge') = 0
			=ErrorMsg("The carrier " + alltrim(.cboCarriersToSelect.displayvalue) + " does not have branches")
			this.lRemain = .t.
			RETURN 1
		endcase
		.cboCarriers.enabled = .f.
	endwith

return dodefault()
LostFocus event
if type("this.lRemain") = "L"
	if this.lRemain
		nodefault
	endif
	this.lRemain = .f.
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform