Torna al Thread

Private Sub DGRIDVIEWOBJ_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DGRIDVIEWOBJ.EditingControlShowing Dim ctrltype As Type = e.Control.GetType If ctrltype.Name = "DataGridViewTextBoxEditingControl" Then Dim tb As TextBox = CType(e.Control, TextBox) RemoveHandler tb.KeyPress, AddressOf TextBox_KeyPress With Me.DGRIDVIEWOBJ Select Case .Columns(.CurrentCell.ColumnIndex).Name Case Is = "col_numerica" AddHandler tb.KeyPress, AddressOf TextBox_KeyPress Case Else AddHandler tb.KeyPress, AddressOf TextBox_KeyPress_char End Select End With End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5