|
|
#1 (permalink) |
|
Üyelik Tarihi: 22.06.2001
Yer: Antalya
Yaş: 38
Mesaj: 531
|
YTL TextBox Change - YTL Mask
Merhaba, Belki birilerinin işine yarıyabilir düşüncesi ile yazıyorum Yazar Kasa ve Kredi Kart makinaları ile aynı TextBox Özellikleri : Name : TextBox1 MaxLength : 14 Text veya Value : 0,00 TextAlign : 3- fmtextAlignRight Kod:
Private Sub TextBox1_Change()
Dim a
a = Replace(TextBox1, ",", "")
a = Replace(a, ".", "")
If IsNumeric(a) = False Then
TextBox1.Value = "0,00"
ElseIf a < 10 Then
TextBox1 = "0,0" & a * 1
ElseIf a < 100 Then
TextBox1 = "0," & a * 1
ElseIf a < 1000 Then
If Mid(a, 1, 1) = 0 Then
TextBox1 = Mid(a, 2, 1) & "," & Right(a, 2)
End If
If Mid(Right(TextBox1, 2), 1, 1) = "," Then
TextBox1 = Mid(a, 1, 1) & "," & Right(a, 2)
End If
If TextBox1.Value Like "*,*" = False Then
TextBox1 = Mid(a, 1, 1) & "," & Right(a, 2)
End If
ElseIf a < 10000 Then
TextBox1 = Mid(a, 1, 2) & "," & Right(a, 2)
ElseIf a < 100000 Then
TextBox1 = Mid(a, 1, 3) & "," & Right(a, 2)
ElseIf a < 1000000 Then
TextBox1 = Mid(a, 1, 1) & "." & Mid(a, 2, 3) & "," & Right(a, 2)
ElseIf a < 10000000 Then
TextBox1 = Mid(a, 1, 2) & "." & Mid(a, 3, 3) & "," & Right(a, 2)
ElseIf a < 100000000 Then
TextBox1 = Mid(a, 1, 3) & "." & Mid(a, 4, 3) & "," & Right(a, 2)
ElseIf a < 1000000000 Then
TextBox1 = Mid(a, 1, 1) & "." & Mid(a, 2, 3) & "." & Mid(a, 5, 3) & "," & Right(a, 2)
ElseIf a < 10000000000# Then
TextBox1 = Mid(a, 1, 2) & "." & Mid(a, 3, 3) & "." & Mid(a, 6, 3) & "," & Right(a, 2)
Else
TextBox1 = Mid(a, 1, 3) & "." & Mid(a, 4, 3) & "." & Mid(a, 7, 3) & "," & Right(a, 2)
End If
End Sub
|
|
|
|
| Sponsorlu Bağlantılar | |
|
Zoque.Forum
Reklam
|
|
Zoque'a hoşgeldiniz!