/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
monitor text-input
Fra : asd987


Dato : 23-11-04 09:25

Hello,

I want to play a sound when certain characters are types in a textbox. So
what I need to do is to check what character is typed and then perform an
action.

How can I monitor which character is typed?

Thanks,

Sjoerd



 
 
Harald Staff (23-11-2004)
Kommentar
Fra : Harald Staff


Dato : 23-11-04 09:41

Hi Sjoerd

A textbox has KeyDown, KeyPress and KeyUp events, all reflecting what's
being typed:

Private Sub Txt1_KeyDown(KeyCode As Integer, Shift As Integer)
Debug.Print "Key " & KeyCode & " going gown"
End Sub

Private Sub Txt1_KeyPress(KeyAscii As Integer)
Debug.Print Chr(KeyAscii) & " is entered"
End Sub

Private Sub Txt1_KeyUp(KeyCode As Integer, Shift As Integer)
Debug.Print "Key " & KeyCode & " going up"
End Sub

HTH. Best wishes Harald

"asd987" <asd987@home.nl> skrev i melding
news:cnus45$abc$1@news6.zwoll1.ov.home.nl...
> Hello,
>
> I want to play a sound when certain characters are types in a textbox. So
> what I need to do is to check what character is typed and then perform an
> action.
>
> How can I monitor which character is typed?
>
> Thanks,
>
> Sjoerd
>
>



Søg
Reklame
Statistik
Spørgsmål : 177580
Tips : 31968
Nyheder : 719565
Indlæg : 6409079
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste