enter'a basılınca herhangi bir yere gitmesin

Katılım
8 Temmuz 2004
Mesajlar
254
Excel Vers. ve Dili
office 2007-mssql 2008 R2
selam

userformda da textbox ta enter'a basılınca command1 butonunu çalıştırıp tekrar textbox'a focus olmasını istiyorum.

kod şu ama olmuyor(yada yanlış var)
Kod:
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = 13 Then
CommandButton1_Click
TextBox1.SetFocus
Else
End If
End Sub
cursor ısrarla butonun üzerine focus oluyor.

kolay gelsin
 
Katılım
3 Mart 2005
Mesajlar
571
Excel Vers. ve Dili
Excel 2000 Ing.
merhaba ,
keydown olayına yazmayı dene


Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
CommandButton1_Click
KeyCode = 0 'enteri iptal ediyor
Else
End If
End Sub
 
Katılım
8 Temmuz 2004
Mesajlar
254
Excel Vers. ve Dili
office 2007-mssql 2008 R2
çok çok teşekkürler :dua: ilginize sorunum çözüldü :hihoho:

kolay gelsin.
 
Üst