用惯了第三方控件fpspread,只一个属性就可以设置输入大写,可用微软原装的DataGridView缺很麻烦,查到一个C#实现,改成VB.NET版本
Private Sub GridTaskList_EditingControlShowing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles GridTaskList.EditingControlShowing Dim dgv As DataGridView = CType(sender, DataGridView) If TypeOf (e.Control) Is DataGridViewTextBoxEditingControl Then Dim EditingControl As DataGridViewTextBoxEditingControl EditingControl = CType(e.Control, DataGridViewTextBoxEditingControl) If dgv.CurrentCell.OwningColumn.DataPropertyName = "Stope_Id" Then EditingControl.CharacterCasing = CharacterCasing.Upper Else EditingControl.CharacterCasing = CharacterCasing.Normal End If End If End Sub
参考:https://www.cnblogs.com/maozhh/archive/2007/09/24/904144.html