18-10-14, 11:18 AM
يمكن تعديل الكود التالبي بحيث يكون اسرع
الكود القديم:
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.SetFocus
End If
strFind = "ZXCVBNMASDFGHJKLQWERTYUIOP[]=ÏÌÍÎåÚÛÝÞËÕÖÔÓíÈáÇÊäãߨÙÒæÉìáÇÑÄÁÆÂáÂÅáÃáÅ~úóðõñöòøÐzxcvbnmasdfghjklqwertyuiop'"
If (InStr(strFind, Chr(KeyAscii)) <> 0) Then KeyAscii = 0
End Sub
الكود الاسرع:
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.SetFocus
End If
strfind = "0123456789."
If (InStr(strfind, Chr(KeyAscii)) = 0) Then KeyAscii = 0
End Sub
الكود القديم:
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.SetFocus
End If
strFind = "ZXCVBNMASDFGHJKLQWERTYUIOP[]=ÏÌÍÎåÚÛÝÞËÕÖÔÓíÈáÇÊäãߨÙÒæÉìáÇÑÄÁÆÂáÂÅáÃáÅ~úóðõñöòøÐzxcvbnmasdfghjklqwertyuiop'"
If (InStr(strFind, Chr(KeyAscii)) <> 0) Then KeyAscii = 0
End Sub
الكود الاسرع:
Private Sub Text11_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text12.SetFocus
End If
strfind = "0123456789."
If (InStr(strfind, Chr(KeyAscii)) = 0) Then KeyAscii = 0
End Sub
