تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
اضافة 0 قبل العلامه العشريه فى التكست بوكس
#1
كنت كتبت الموضوع بشكل ممكن يكون غلط 
ده كود يمنع انه يدخل اى شىء غير الارقام و backspace
وكنت طالب مساعده انه يكتب قبل العلامه العشريه صفر
PHP كود :
If (Char.IsControl(e.KeyChar) = False) And (Char.IsDigit(e.KeyChar) = False) And Char.IsControl(e.KeyChar) = False Then
            e
.Handled True
        End 
If 
الرد }}}
تم الشكر بواسطة:
#2
(07-10-17, 01:14 AM)نبيل فتحى كتب : كنت كتبت الموضوع بشكل ممكن يكون غلط 
ده كود يمنع انه يدخل اى شىء غير الارقام و backspace
وكنت طالب مساعده انه يكتب قبل العلامه العشريه صفر
PHP كود :
If (Char.IsControl(e.KeyChar) = False) And (Char.IsDigit(e.KeyChar) = False) And Char.IsControl(e.KeyChar) = False Then
            e
.Handled True
        End 
If 

كود اظهار الصفر :
كود :
doubleValue.ToString("#.##"))
اما اذا اردت ان تسمح لكتابه ارقام فقط فهذا الكود 
كود :
if IsNumeric(textbox1.text) then

end if


الرد }}}
تم الشكر بواسطة:
#3
(07-10-17, 02:01 AM)Rabeea Qbaha كتب :
(07-10-17, 01:14 AM)نبيل فتحى كتب : كنت كتبت الموضوع بشكل ممكن يكون غلط 
ده كود يمنع انه يدخل اى شىء غير الارقام و backspace
وكنت طالب مساعده انه يكتب قبل العلامه العشريه صفر
PHP كود :
If (Char.IsControl(e.KeyChar) = False) And (Char.IsDigit(e.KeyChar) = False) And Char.IsControl(e.KeyChar) = False Then
            e
.Handled True
        End 
If 

كود اظهار الصفر :
كود :
doubleValue.ToString("#.##"))
اما اذا اردت ان تسمح لكتابه ارقام فقط فهذا الكود 
كود :
if IsNumeric(textbox1.text) then

end if
انا مش عارف الكود فى ايرور 
PHP كود :
 Private Sub txtqty_KeyPress(sender As ObjectAs KeyPressEventArgsHandles txtqty.KeyPress
        If Not Double
.TryParse((txtqty.Text e.KeyChar), Nothing) And Char.IsControl(e.KeyChar) = False Then
            e
.Handled True

        End 
If
 
       txtqty.ToString("#.##"))
 
   End Sub 

وجربت كذا حاجه بس برده هو احنا قريبين
الرد }}}
تم الشكر بواسطة:
#4
PHP كود :
Private Sub txtqty_LostFocus(ByVal sender As ObjectByVal e As EventArgsHandles txtqty.LostFocus
    sender
.Text Val(sender.Text)
End Sub 
الرد }}}
تم الشكر بواسطة: Amir_Alzubidy , عبد العزيز البسكري
#5
(07-10-17, 06:51 AM)a.ahmed كتب :
PHP كود :
Private Sub txtqty_LostFocus(ByVal sender As ObjectByVal e As EventArgsHandles txtqty.LostFocus
    sender
.Text Val(sender.Text)
End Sub 
برده مش شغال للاسف
الرد }}}
تم الشكر بواسطة:
#6
PHP كود :
Private Sub TextBox1_GotFocus(ByVal sender As ObjectByVal e As EventArgsHandles TextBox1.GotFocus
    sender
.ShortcutsEnabled False
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As ObjectByVal e As KeyPressEventArgsHandles TextBox1.KeyPress
    If sender
.SelectionLength sender.Text.Length Then sender.Clear()
 
   If Not (Char.IsControl(e.KeyChar) Or Char.IsNumber(e.KeyChar) Or e.KeyChar "." And Not sender.Text.Contains(".")) Then e.Handled True
    If sender
.Text.Length And e.KeyChar "." Then sender.Text "0." sender.SelectionStart sender.Text.Length e.Handled True
End Sub
Private Sub TextBox1_LostFocus(ByVal sender As ObjectByVal e As EventArgsHandles TextBox1.LostFocus
    sender
.Text Val(sender.Text)
End Sub 
الرد }}}
تم الشكر بواسطة: نبيل فتحى , عبد العزيز البسكري
#7
(08-10-17, 02:45 AM)a.ahmed كتب :
PHP كود :
Private Sub TextBox1_GotFocus(ByVal sender As ObjectByVal e As EventArgsHandles TextBox1.GotFocus
    sender
.ShortcutsEnabled False
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As ObjectByVal e As KeyPressEventArgsHandles TextBox1.KeyPress
    If sender
.SelectionLength sender.Text.Length Then sender.Clear()
 
   If Not (Char.IsControl(e.KeyChar) Or Char.IsNumber(e.KeyChar) Or e.KeyChar "." And Not sender.Text.Contains(".")) Then e.Handled True
    If sender
.Text.Length And e.KeyChar "." Then sender.Text "0." sender.SelectionStart sender.Text.Length e.Handled True
End Sub
Private Sub TextBox1_LostFocus(ByVal sender As ObjectByVal e As EventArgsHandles TextBox1.LostFocus
    sender
.Text Val(sender.Text)
End Sub

ايوه كده يا هندسه 
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم