Private Sub dataGridView1_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs)
Dim combo As ComboBox = TryCast(e.Control, ComboBox)
If combo IsNot Nothing Then
combo.SelectedIndexChanged -= New EventHandler(AddressOf ComboBox_SelectedIndexChanged)
combo.SelectedIndexChanged += New EventHandler(AddressOf ComboBox_SelectedIndexChanged)
End If
End Sub
Private Sub ComboBox_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim cb As ComboBox = DirectCast(sender, ComboBox)
Dim item As String = cb.Text
If item IsNot Nothing Then
MessageBox.Show(item)
End If
End Sub
Private Sub dataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs)
Dim combo As ComboBox = TryCast(e.Control, ComboBox)
If combo IsNot Nothing Then
combo.SelectedIndexChanged -= New EventHandler(AddressOf ComboBox_SelectedIndexChanged)
combo.SelectedIndexChanged += New EventHandler(AddressOf ComboBox_SelectedIndexChanged)
End If
End Sub
Private Sub ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim cb As ComboBox = DirectCast(sender, ComboBox)
Dim item As String = cb.Text
If item IsNot Nothing Then
MessageBox.Show(item)
End If
End Sub
Private Sub ComboBox_SelectionChangeCommitted(ByVal sender As Object, ByVal e As EventArgs)
Dim cb As ComboBox = DirectCast(sender, ComboBox)
Dim item As String = cb.Text
MsgBox(item)
If item IsNot Nothing Then
Exit Sub
Else
Dim FrmFinStockSeach As New FrmFineStockShearch
FrmFinStockSeach.ShowDialog()
End If
End Sub
Private Sub DGV1_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DGV1.EditingControlShowing
Dim Cbo As ComboBox = TryCast(e.Control, ComboBox)
If Cbo IsNot Nothing Then
RemoveHandler Cbo.SelectionChangeCommitted, New EventHandler(AddressOf ComboBox_SelectionChangeCommitted)
AddHandler Cbo.SelectionChangeCommitted, New EventHandler(AddressOf ComboBox_SelectionChangeCommitted)
End If
End Sub