keypressed event Handler

Hi everyone
i’m using keypressed event Handler to textfield but i dont know how to make it work only for specific keys , for exemple ENTER ONLY.

[quote=195590:@Boudali Alae]Hi everyone
i’m using keypressed event Handler to textfield but i dont know how to make it work only for specific keys , for exemple ENTER ONLY.[/quote]

I suppose you are talking about a WebTextField…

What do you mean by “Make it work” ? You want to prevent any key to work except Enter ? Or something else ?

[quote=195591:@Michel Bujardet]I suppose you are talking about a WebTextField…

What do you mean by “Make it work” ? You want to prevent any key to work except Enter ? Or something else ?[/quote]

i’m using a listbox and text field and i want to add what is wroten in the text field to the list box by pressing ENTRE

check for CHRB(3) or CHRB(13) in the KEYDOWN event… one is [RETURN] the other is [ENTER]

I didn’t understand

read the language ref about KeyDown events, and CHR function, then come back and ask again for clarificaiton if you don’t understand … but do please make an effort

If you want adequate help, you must give more details. Keypressed does not exist in a Desktop TextField. So I thought you were talking about a Web project. So, is it a Desktop or Web project you have started ?

What Dave told you is for a Desktop project, and valid as well.

The basic principle is that you look for Chr(13) which is the Enter key, and use TextField.Text to set the appropriate cell in the ListBox.

From what you posted so far, I get the distinct impression that you need to read a bit more about the basics of Xojo.

Look in the installation folder of Xojo, locate the Documentation folder, and inside read UserGuide.Fundamentals.pdf ; it should get you more comfortable about the whole thing.