Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Webbrowser and combobox, item not visible after enter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00966761
Message ID:
00966807
Vues:
6
This message has been marked as the solution to the initial question of the thread.
The typed text is stored in This.DisplayValue.
LPARAMETERS nKeyCode, nShiftAltCtrl

IF nKeyCode = 13  THEN && Enter
	lExists = .F.
	FOR i = 1 TO this.ListCount 
		IF this.ListItem(i) = ALLTRIM(This.DisplayValue)
			lExists = .T.
                        EXIT
		ENDIF 
	ENDFOR 	
	IF NOT lExists 
		this.AddItem(This.DisplayValue)
	ENDIF 		
    thisform.oWeb.Navigate(This.DisplayValue) 
ENDIF 
>
>I have a combobox and a webbroser on my form. If a user types a web address and enters "enter" in the combobox the webbrowser has to navigate to the specified address. When I press enter in the combobox the browser navigates ok but the specified item in the combobox is not active(it is empty) I thought I could write code in the KeyPress event of the combobox as such :
>
>IF nKeyCode = 13  THEN && Enter
>	lExists = .F.
>	FOR i = 1 TO this.ListCount
>		IF this.ListItem(i) = ALLTRIM(this.Text)
>			lExists = .T.
>		ENDIF
>	ENDFOR 	
>	IF NOT lExists
>		this.AddItem(this.Text)
>	ENDIF 		
>    thisform.oWeb.Navigate(this.Text) && this causes that the item is
>                                  && not active in the combobox
>                                  && combobox is empty
>ENDIF
>
>
>What could I do to make this working. Thanks.
>
>P.S. If you have any comments about the code or other suggestions, you're welcome to give feedback
>
>Zakaria al Azhar
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform