我有以下代码,允许我检测datagridview的EditingControlShowing事件下对datagridview comobobox列所做的更改 我已经知道除了什么之外它是如何工作的
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object,
ByVal e As DataGridViewEditingControlShowingEventArgs) _
Handles DataGridView1.EditingControlShowing
If DataGridView1.CurrentCell.ColumnIndex = 1 Then
Dim combo As ComboBox = CType(e.Control, ComboBox)
If (combo IsNot Nothing) Then
RemoveHandler combo.SelectionChangeCommitted, New EventHandler(AddressOf ComboBox_SelectionchangeCommitted)
AddHandler combo.SelectionChangeCommitted, New EventHandler(AddressOf ComboBox_SelectionchangeCommitted)
End If
End If
End Sub
我不明白的是 = CType(e.Control,ComboBox)
什么是e.control以及为什么使用CType以及为什么所有这些=组合 整个提到的行对我来说是不可理解的