تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
نرجع مرة ثانية , الاداة datagrideview ممنوع تكتب حروف بس في مشكلة
#2
PHP كود :
Private Sub txtEdit_Keypress(ByVal sender As ObjectByVal e As System.Windows.Forms.KeyPressEventArgs)
    If e.KeyChar "." And sender.Text.Contains("."Then
        e
.Handled True
        
Exit Sub
    End 
If

    'هنا نسمح بكتابة ارقام فقط وحقول معينة بها فاصلة 
    Console.WriteLine("KeyPress " & e.KeyChar.ToString())
    '
Test for numeric value or backspace in first column
    
If DataGridViewX1.CurrentCell.ColumnIndex 0 Then
        
If IsNumeric(e.KeyChar.ToString()) _
        
Or e.KeyChar ChrW(Keys.Back_
        
Or e.KeyChar "." Then
            Console
.WriteLine("KeyPress number")
            e.Handled False 'if numeric display 
        Else
            Console.WriteLine("Enter Numbers Only")
            e.Handled = True  '
if non numeric don't display
        End If
    End If

    '
***********************************************************

    If DataGridViewX1.CurrentCell.ColumnIndex Or DataGridViewX1.CurrentCell.ColumnIndex Or DataGridViewX1.CurrentCell.ColumnIndex 4 Then

        
'  If DataGridView1.CurrentCell.ColumnIndex = 0 Then
        If IsNumeric(e.KeyChar.ToString()) _
        Or e.KeyChar = ChrW(Keys.Back) _
        Or e.KeyChar = "." Then
            Console.WriteLine("KeyPress number")
            e.Handled = False '
if numeric display 
        
Else
            Console.WriteLine("Enter Numbers Only")
            e.Handled True  'if non numeric don't display
        End 
If
    End If

    '*-*-********************************************************

End Sub 
الرد }}}


الردود في هذا الموضوع
RE: نرجع مرة ثانية , الاداة datagrideview ممنوع تكتب حروف بس في مشكلة - بواسطة طالب برمجة - 05-02-18, 10:49 AM


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


يقوم بقرائة الموضوع: