PCTurk | Aşk Sevgi Resimleri , Mektupları , silkroad , komik msn avatarlar (Arşiv Ana sayfa) => Visual Basic

Konu: Sadece Sayı girişi (Combo ve Text'e giriş yaparken)

Sayfa: [ 1 ]

sWaGg€r 27.06.2008 20:27:09
Bir text kutusuna veya comboya  yapılacak girişlerin sadece sayısal olması isteniyorsa :
Private Sub Combo1_Change()
If Not IsNumeric(Combo1.Text) Then Combo1.Text = "": Exit Sub
End Sub

Private Sub Text1_Change()
If Not IsNumeric(Text1) Then Text1 = "": Exit Sub
End Sub

' veya keypress ile sadece sayı girilebilsin
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End If
End Sub


Sayfa: [ 1 ]