18-11-23, 10:55 AM
(18-11-23, 01:46 AM)sniper2030 كتب : Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
' إذا تم الضغط على زر Enter
If e.KeyChar = ChrW(Keys.Enter) Then
' نحرك مؤشر الكتابة إلى نهاية النص في TextBox1
TextBox1.SelectionStart = TextBox1.Text.Length
' نقوم بمنع الحرف من الظهور في TextBox1
e.Handled = True
End If
End Sub
Private Sub TextBox2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox2.KeyPress
' إذا تم الضغط على زر Enter
If e.KeyChar = ChrW(Keys.Enter) Then
' نحرك مؤشر الكتابة إلى نهاية النص في TextBox2
TextBox2.SelectionStart = TextBox2.Text.Length
' نقوم بمنع الحرف من الظهور في TextBox2
e.Handled = True
End If
End Sub
جرب هذا الكود
شكرا اخي على الرد جربت الكود ولاكن للاسف لايعمل
