Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
EVEN - keypress
KEYPRESS EVENT

Hye,
Today we learn to use the KEYPRESS event.
we make a little soft who write one letter pressed in the label.
Make own window :
create :
2 labels
1 textarea
1 button
here you find the windows :

clavier.jpg

now here is code :

PUBLIC SUB _new()
END
PUBLIC SUB form_OPEN()
END
PUBLIC SUB button1_click()
quit
END
PUBLIC SUB form_keypress()
DIM ltext AS variant
ltext = key.text
label2.text = ltext
END
PUBLIC SUB form_keyrelease()
DIM ltext AS variant
ltext = key.text
label2.text = ltext
END

 very simple,isn't it ?
wink

Creation date : 21/04/2009 @ 12:40
Last update : 10/03/2012 @ 10:33
Category : EVEN
Page read 7211 times


Print the article Print the article


react.gifReactions to this article


Reaction #1 

by Pablodetaix 28/10/2009 @ 18:52

Bonjour,
l'exemple ma permit d'utiliser cette fonction
et je me permet de le compléter par le cas
des touches qui n'ont pas d'écho "texte"

on frappe "fleche vers le haut" ?
If Key.Code = Key.Left then etc etc etc
ou Key.Left représente une des constantes
interne Gambas.

Key.Text renvoit le 'symbole' Key.Code renvoit la const.

Bons tests !
Pablodetaix

QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^