10-01-16, 03:16 PM
10-01-16, 07:02 PM
لنفترض أن لديك عدد 2 مربع نص وسيتم التنقل بينهما باستخدام مفتاح ENTER
أدخل الكود في التالي حدث Keypress لكل مربع نص
أدخل الكود في التالي حدث Keypress لكل مربع نص
كود :
Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
كود :
Private Sub Text2_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
10-01-16, 09:22 PM
في الحدث KeyPress الخاص ب الفورم يمكنك ان تستحدم الكود بالشكل التالي عندما يتم الضغط علي المفتاح Enter
PHP كود :
SelectNextControl(ActiveControl, True, True, True, True)
20-02-16, 11:52 AM
يمكن استخدام الكود التالي في حدث KeyDown
If e.KeyValue = Keys.Enter Or e.KeyValue = Keys.Tab Then
TextBox2.Focus()
End If
فيما يخص استخدام Enter فقط
If e.KeyValue = Keys.Enter Then
TextBox4.Focus()
End If
If e.KeyValue = Keys.Enter Or e.KeyValue = Keys.Tab Then
TextBox2.Focus()
End If
فيما يخص استخدام Enter فقط
If e.KeyValue = Keys.Enter Then
TextBox4.Focus()
End If