当我的标签有焦点并且有人点击“Enter”时,我试图让这个子执行这是我到目前为止的代码......
Private Sub AssignOwnersLabel_Click() Handles AssignOwnersLabel.Click
Dim repository As OwnerRepositorySvc.OwnerRepositoryClient = Nothing
For Each programRow As DataGridViewRow In ProgramOwnerFill.SelectedRows
programRow.Cells(0).Value = AssignOwnersTXTBox.Text
Next
repository = OpenRepository()
repository.SaveOwners(_ds)
_ds.AcceptChanges()
CloseRepository(repository)
Dim dataview As DataView = _ds.ProgramOwners.DefaultView
dataview.Sort = _ds.ProgramOwners.EmployeeIDColumn.ColumnName
Me.ProgramOwnersBindingSource.DataSource = dataview
End Sub
我认为要让它工作,我需要用“keychar”做一些事情,但我不确定它会是什么样子。感谢帮助!