العفو
أضف اداتين RadioButton
الاول ارقام والثاني ارقام وحروف
أضف اداتين RadioButton
الاول ارقام والثاني ارقام وحروف
كود :
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Char.IsControl(e.KeyChar) = True Then Exit Sub
If RadioButton1.Checked = True AndAlso Char.IsDigit(e.KeyChar) = False Then
MsgBox("ارقام فقط")
e.Handled = True
ElseIf RadioButton2.Checked = True AndAlso Char.IsLetterOrDigit(e.KeyChar) = False Then
MsgBox("ارقام او حروف فقط")
e.Handled = True
End If
End Sub
الْلَّهُم صَلِّ وَسَلِم وَبَارِك عَلَى سَيِّدِنَا مُحَمَّد
